telegram-bot-ruby
telegram-bot-ruby copied to clipboard
Fixed to_compact_hash not working on Chat and Array object
For an object message of type Telegram::Bot::Types::Message, if you call
message.to_compact_hash
The chat and entities attribute don't get converted to a hash.
I fixed it by making Chat class inherit Base (because the condition on calling to_compact_hash in the method is only checking whether the class inherits Base or not). Another alternative is by adding additional inherited class in the condition (Telegram::Bot::Types::Compactable)
Also, arrays of compactables don't get converted properly, I setup recursive method to convert arrays too.