Sha256: aa7a3dc37212c567ce74eb5a1a8ca2ef77c6f31de9686c285bf911df22ceaed2

Contents?: true

Size: 455 Bytes

Versions: 2

Compression:

Stored size: 455 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

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