require 'telegram_bot/params/shared/user_component' module Telegram module Params class From < UserComponent def initialize(params) message = params.require(:message) @params = message[:from] # If from exist then return nil return nil if @params.blank? from_params = message.require(:from) super(from_params) end def nil? super || @params.nil? end end end end