Class: TelegramBotEngine::DeliveryJob
- Inherits:
-
ApplicationJob
- Object
- ApplicationJob
- TelegramBotEngine::DeliveryJob
- Defined in:
- app/jobs/telegram_bot_engine/delivery_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(chat_id, text, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/jobs/telegram_bot_engine/delivery_job.rb', line 8 def perform(chat_id, text, = {}) Telegram.bot.( chat_id: chat_id, text: text, **.symbolize_keys ) rescue Telegram::Bot::Forbidden # User blocked the bot - deactivate subscription TelegramBotEngine::Subscription.where(chat_id: chat_id).update_all(active: false) Rails.logger.info("[TelegramBotEngine] Deactivated subscription for blocked chat: #{chat_id}") end |