Exception: Telegram::Bot::StaleChat
- Defined in:
- lib/telegram/bot.rb
Overview
Error class for events when chat is not available anymore for bot. While Telegram has same error codes for different messages and there is no official docs for this error codes it uses description to check response.
Constant Summary collapse
- DESCRIPTIONS =
[ 'Bot was blocked', 'bot was kicked', "can't write to", 'group chat is deactivated', ].freeze
Class Method Summary collapse
Class Method Details
.match_response?(response) ⇒ Boolean
23 24 25 26 |
# File 'lib/telegram/bot.rb', line 23 def match_response?(response) description = response['description'].to_s DESCRIPTIONS.any? { |x| description[x] } end |