Skip to content

Commit

Permalink
Telegram refactoring:
Browse files Browse the repository at this point in the history
- Fixes zammad#2289 - Added Telegram video support.
- Improved error handling via raise Exceptions.
- Removed unused methods.
- Fixed typos.
- Improved messages to client - return status: :ok even if the message could not be processed. This stops the Webhook loop for these message.
  • Loading branch information
Denny Korsukéwitz authored and thorsteneckel committed Oct 21, 2019
1 parent 8d16bcb commit 7c93565
Show file tree
Hide file tree
Showing 43 changed files with 1,052 additions and 1,081 deletions.
6 changes: 5 additions & 1 deletion app/controllers/channels_telegram_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def webhook
end

telegram = Telegram.new(channel.options[:api_token])
telegram.to_group(params, channel.group_id, channel)
begin
telegram.to_group(params, channel.group_id, channel)
rescue Exceptions::UnprocessableEntity => e
Rails.logger.error e.message
end

render json: {}, status: :ok
end
Expand Down
Loading

0 comments on commit 7c93565

Please sign in to comment.