telegram-bot-ruby icon indicating copy to clipboard operation
telegram-bot-ruby copied to clipboard

Add activesupport support

Open vsevolod opened this issue 3 years ago • 0 comments

I've got this message when using the gem:

Telegram::Bot::Exceptions::ResponseError: Telegram API has returned the error. (ok: "false", error_code: "400", description: "Bad Request: can't parse inline query result: Field "url" must be of type String")

This was because activesupport calls as_json instead to_json while using to_json on an array. And the objects (Telegram::Bot::Types::InputTextMessageContent.new) didn't compact.

This PR fix it

Also I rewrote to_compact_hash method. Now it runs faster and creates less objects.

vsevolod avatar Mar 07 '22 21:03 vsevolod