telegramium icon indicating copy to clipboard operation
telegramium copied to clipboard

Runtime Exception

Open terjokhin opened this issue 3 years ago • 2 comments

Basically, my bot doesn't work at all, because of broken json derivation. Recently Telegram has updated its api and has added custom emojis.

I'm getting scala.MatchError: custom_emoji (of class java.lang.String) exception

Is it possible to add logic to drop unsupported messages with warning in logs instead of getting such exception? Or add some configuration what to do throw or not.

terjokhin avatar Aug 13 '22 07:08 terjokhin

I've published a new Telegramium version supporting Telegram Bot API 6.2, it should (hopefully) fix this error: https://github.com/apimorphism/telegramium/releases/tag/7.62.0. In the meantime I'll think how to avoid this type of errors in the future.

johnspade avatar Aug 13 '22 10:08 johnspade

I think it would be nice to just send warning message that syas something like "looks like you version isn't compatible with current tg api, pls update or do nothing" =)

terjokhin avatar Aug 13 '22 13:08 terjokhin

I really don't want to drop any messages, because parsing can fail for a lot of reasons including bugs in the library. I've added a suggestion to update Telegramium to decoding errors, thanks.

The problem is that Bot API added a new enum value and it's a breaking change for this library. It looks like other Scala/Java Telegram Bot API libraries don't try to be forward compatible in this regard too.

johnspade avatar Oct 23 '22 21:10 johnspade