Hacker News new | ask | show | jobs
by ATsch 3243 days ago
I have not looked at this in detail, but I can't see what advantages this has over just sending a simple http request like this:

  https://api.telegram.com/botTOKEN/sendMessage?id=YOUR_ID&message="your servers are on fire"

because that's all you need as far as I know. Works via GET, POST, PUT, everything.

Only thing I could see is being able to switch it out for other services easier.

1 comments

You're right, but you'd need your own specific Telegram-internal user id so that your message will only be routed to your specific chat. With my little piece of code, n people can register at 1 bot. Without it you would either have to figure out your user id first or have n separate bots for n people. Of course, the advantage is not too dramatic ;-) And yes, the ability to link the bot to further services than only Telegram is another plus.
You can get your own (or group's) chat ID with @get_id_bot, if you don't want to just get it yourself via `getUpdates`.