3 ms·
Telegram has some nice features from a user's perspective (arbitrary filetype file attachment, animated voice records so I can skip quiet portions, good chat se
by fuzzybear3965 5y ago
Telegram has some nice features from a user's perspective (arbitrary filetype file attachment, animated voice records so I can skip quiet portions, good chat search, private chat support, and video-/picture-/file-/message -specific search). But, one of the main utilities on Telegram is its bot platform. And, as a developer: Building bots with Telegram is difficult. This is mostly a documentation issue.
AFAIK this is the main documentation page: https://core.telegram.org/bots/api https://core.telegram.org/bots/api which, subjectively speaking is really hard to read, and, objectively speaking, offers no sample responses/interactivity.
This page tries to fill the gap on tutorials/how-to: https://core.telegram.org/bots https://core.telegram.org/bots but without sample code.
There are a few bots you can find on GitHub, but nothing official that I could find.
Documentation on bot limitations in channels vs. groups is also really spotty.
Trying to detect who joined a group/channel and greet them, for example, or trying to send a message on departure, is non-trivial.
- ilovefood 5y agoI can't confirm or deny since I've been only using telegram as a way to get notifications for some batch jobs or other things I want to keep an eye out for and that use case has been a breeze. I'm having a script constantly checking when the PS5 will be available on amazon and get a notification when that happens to (hopefully) have a chance to get one. I think I might help there, I'll post an article as soon as I can about that with the hope that it'll get people started. Some years ago I did use Whatsapp to write bots and there was absolutely no documentation at that time but it's possible. What's your use case exactly? Would you like to use Telegram Channels / Groups the way Discord channels are used?
- tiagod 5y agoI disagree with you, I find the API quite uniform, powerful and enjoyable to use (I'm only annoyed by the recent increase in rate limiting). They offer a nice list of every method and all the parameters, and what they're for, and all the return objects are also documented. Everything is on that single page which is great for CTRL+F. There's also wrappers for many languages that will have auto-documentation on IDEs like IntelliJ and usage examples. What I really dislike is Telegram's avoidance of E2EE. Very sketchy.
- athorax 5y agoI'd generally agree that the first party documentation isn't great. There is a list of code examples[0] that I found pretty useful though. I picked one of the python ones and dug into it to get a better idea how everything is setup [0]: https://core.telegram.org/bots/samples https://core.telegram.org/bots/samples
- agentdrtran 5y agoyeah, bots are rock solid once you figure them out but it took me ages just to figure out how to get a token for another app to use.
- theshrike79 5y agoDunno how it could be easier than this: curl -X POST \ -H 'Content-Type: application/json' \ -d '{"chat_id": "123456789", "text": "This is a test from curl", "disable_notification": true}' \ https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage
- GekkePrutser 5y agoExactly, this is a great feature for notifications. I use it a lot with my home assistant and other notifications like system management scripts. I even have a MotionEye cam send me little videos when it detects motion. Telegram is amazing for this.