Which library offers better architecture: go-telegram/bot or go-telegram-bot-api?

I have been learning Go and started creating a Telegram bot. Initially, I used go-telegram-bot-api, but I learned it hasn’t been updated since 2021. I switched to go-telegram/bot and really like its code structure. I’m interested in hearing from other developers about their experiences with both libraries. What do you think about their coding architectures? I’ve noticed some developers continue to use the old library because they prefer its layout, even though it’s no longer maintained. Please share your opinions on which library you like better and the reasons behind your choice.

I’ve used both libraries extensively. go-telegram/bot has way better architecture - proper context handling and follows modern Go conventions. go-telegram-bot-api was decent but it’s basically abandoned now, so you’ll hit walls with newer Telegram features. I migrated a production bot last year and it was worth the effort. The error handling is much better and the middleware support makes debugging a breeze. Unless you’ve got legacy code that’d be a nightmare to change, go with the maintained library.

Absolutely! I feel like go-telegram/bot has a really nice structure and is way more up-to-date. Sure, some might like the old one because it’s what they know, but for anything new, the newer library just makes more sense.

From an architecture perspective, go-telegram/bot crushes it. The type safety alone makes it worth switching - you get compile-time checking for webhook configs and API responses that just fail silently in the older library. What really got me was how cleanly it handles concurrent operations. No more manual goroutine management like I had to deal with in go-telegram-bot-api. The builder pattern for messages is way more intuitive too. I tried sticking with the old library on one project because of existing code, but hit issues with newer bot features that just weren’t supported. Had to migrate anyway, so you might as well start fresh with better tooling.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.