diff --git a/lib/discourse_chat/provider/telegram/telegram_command_controller.rb b/lib/discourse_chat/provider/telegram/telegram_command_controller.rb index 27b5344..96c31d3 100644 --- a/lib/discourse_chat/provider/telegram/telegram_command_controller.rb +++ b/lib/discourse_chat/provider/telegram/telegram_command_controller.rb @@ -29,7 +29,7 @@ module DiscourseChat::Provider::TelegramProvider DiscourseChat::Provider::TelegramProvider.sendMessage(message) - elsif params.key?('channel_post') && params['channel_post']['text'].include?('/getchatid') + elsif params.dig('channel_post', 'text')&.include?('/getchatid') chat_id = params['channel_post']['chat']['id'] message_text = I18n.t(