Sha256: 7b4e00c71cf5834e31b8eb9546d829783502a2ccc59cb06e8d63c6d07de91af6

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

require 'telegram_bot/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

2 entries across 2 versions & 1 rubygems

Version Path
tg-bot-0.0.2 lib/telegram_bot/params/forward_chat.rb
tg-bot-0.0.1 lib/telegram_bot/params/forward_chat.rb