require 'telegram_bot/params/shared/chat_component' module Telegram module Params class Chat < ChatComponent def initialize(params) message = params.require(:message) @params = message[:chat] # If from exist then return nil return nil if @params.blank? chat_params = message.require(:chat) super(chat_params) end def nil? super || @params.nil? end end end end