Attempt to fix crash when bot is added/removed from group

pull/6/head
Aaron Johnson 7 years ago
parent f9342b164d
commit 81613135d1

@ -1,7 +1,8 @@
def validate_incoming_data(message) def validate_incoming_data(message)
message = message.message if message.is_a? Telegram::Bot::Types::CallbackQuery message = message.message if message.is_a? Telegram::Bot::Types::CallbackQuery
return "Received message is not from a valid source! Type: \"#{message.chat.type}\". Ignoring." if ! @allowed_sources.include?(message.chat.type) return "Received message is not from a valid source! Type: \"#{message.chat.type}\". Ignoring." if ! @allowed_sources.include?(message.chat.type)
puts message.chat.type return "Unauthorized user sent message. User ID: #{message.from.id} Source ID: #{message.chat.id}." if ! @conf['auth_chat'].include?(message.chat.id.to_s)
#puts message.chat.type
return true return true
end end

Loading…
Cancel
Save