feat: Enable reauthorization for Facebook (#1286)

This commit is contained in:
Sojan Jose
2020-09-30 01:12:32 +05:30
committed by GitHub
parent 99ca54fd3c
commit b862817b29
20 changed files with 281 additions and 15 deletions

View File

@@ -6,7 +6,11 @@ class Facebook::SendOnFacebookService < Base::SendOnChannelService
end
def perform_reply
FacebookBot::Bot.deliver(delivery_params, access_token: message.channel_token)
result = FacebookBot::Bot.deliver(delivery_params, access_token: message.channel_token)
message.update!(source_id: JSON.parse(result)['message_id'])
rescue Facebook::Messenger::FacebookError => e
Rails.logger.info e
channel.authorization_error!
end
def fb_text_message_params