Sha256: 9dd63bdb53f601da63e3f27dff01fc4a8aa3e6a5baa210bbabe0c7a6cc81e5e9

Contents?: true

Size: 500 Bytes

Versions: 3

Compression:

Stored size: 500 Bytes

Contents

require 'telegram/params/shared/chat_component'

module Telegram
  module Params
    class ForwardChat < ChatComponent
      def initialize(params)
        message = params.require(:message)
        @params = message[:forward_from_chat]
        # If from exist then return nil 
        return nil if @params.blank?

        forward_from_params = message.require(:forward_from_chat)
        super(forward_from_params)
      end

      def nil?
        super || @params.nil?
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tg-bot-0.0.5 lib/telegram/params/forward_chat.rb
tg-bot-0.0.4 lib/telegram/params/forward_chat.rb
tg-bot-0.0.3 lib/telegram/params/forward_chat.rb