Telegramium-6.53.0
Telegramium-6.53.0 released.
This MAJOR release introduces significant breaking changes.
Notable changes
The library now provides a way to compose multiple Webhook bots into a single Http4s
Server that will handle the webhooks registration as well as the incoming requests of all the composed bots. You ultimately decide at which host:port the server will be binded to:
import scala.concurrent.ExecutionContext.Implicits.global
val api1: Api[IO] = BotApi(http, baseUrl = s"https://api.telegram.org/bot$bot_token1")
val api2: Api[IO] = BotApi(http, baseUrl = s"https://api.telegram.org/bot$bot_token1")
val bot1: MyWebhookbot = new MyWebhookbot[IO](api1, "ServerVisibleFromOutside", s"/$bot_token1")
val bot2: MyWebhookbot = new MyWebhookbot[IO](api2, "ServerVisibleFromOutside", s"/$bot_token2")
WebhookBot.compose[IO](
List(bot1, bot2),
8080,
ExecutionContext.global, //optional, global as default
"127.0.0.1" //optional, localhost as default
).useForever.runSyncUnsafe()
For details, have a look at the Github Issue and the related Pull Request.
Error handling
LongPollBot no longer crashes on errors and prints stacktraces instead (for now).
Fixes
#149: DecodingFailure for the callback_game field