feat: Telegram Channel (#2901)
- Ability to configure telegram bots as a channel in chatwoot - Receive a message sent to the telegram bot in chatwoot - Ability to reply to telegram users from chatwoot - Receive attachment messages in chatwoot fixes: #1843
This commit is contained in:
@@ -11,6 +11,8 @@ class SendReplyJob < ApplicationJob
|
||||
::Twitter::SendOnTwitterService.new(message: message).perform
|
||||
when 'Channel::TwilioSms'
|
||||
::Twilio::SendOnTwilioService.new(message: message).perform
|
||||
when 'Channel::Telegram'
|
||||
::Telegram::SendOnTelegramService.new(message: message).perform
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
12
app/jobs/webhooks/telegram_events_job.rb
Normal file
12
app/jobs/webhooks/telegram_events_job.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class Webhooks::TelegramEventsJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(params = {})
|
||||
return unless params[:bot_token]
|
||||
|
||||
channel = Channel::Telegram.find_by(bot_token: params[:bot_token])
|
||||
return unless channel
|
||||
|
||||
Telegram::IncomingMessageService.new(inbox: channel.inbox, params: params['telegram'].with_indifferent_access).perform
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user