Skip to content

Commit 0952104

Browse files
committed
initialize bot client within TelegramBackgroundWorkerJob
Active job run in a separate process or thread from the main Rails application server.
1 parent 5184fbd commit 0952104

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/jobs/telegram_background_worker_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def perform(args)
2626
private
2727

2828
def bot
29-
@bot ||= Rails.application.config.telegram_bot
29+
@bot ||= Telegram::Bot::Client.new(Rails.application.credentials.dig(:telegram_bot_token))
3030
end
3131

3232
def delete_message(chat_id:, message_id:)

0 commit comments

Comments
 (0)