Added support for Telegram Business bots. Telegram webhooks from such bots include the business_message field, which we transform into a standard message for Chatwoot. This PR also modifies how we handle replies, attachments, and image uploads when working with Telegram Business bots. demo: https://drive.google.com/file/d/1Yz82wXBVRtb-mxjXogkUju4hlJbt3qyh/view?usp=sharing&t=4 Fixes #10181
This commit is contained in:
@@ -5,6 +5,7 @@ class Telegram::UpdateMessageService
|
||||
pattr_initialize [:inbox!, :params!]
|
||||
|
||||
def perform
|
||||
transform_business_message!
|
||||
find_contact_inbox
|
||||
find_conversation
|
||||
find_message
|
||||
@@ -36,4 +37,8 @@ class Telegram::UpdateMessageService
|
||||
@message.update!(content: edited_message[:caption])
|
||||
end
|
||||
end
|
||||
|
||||
def transform_business_message!
|
||||
params[:edited_message] = params[:edited_business_message] if params[:edited_business_message].present?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user