It’s been a while (2-3 years I guess?), So details are a bit fuzzy.
Still have the code.
You have different types of bots for Telegram, one of which is “just” as an extra “user” in a group conversation, and thus receives ALL messages. You also have others who only respond to certain commands and therefore only receive those commands.
When I wrote it, I did it very simply; just a nodejs script that ran on a netbook.
Every five seconds I call ‘https://api.telegram.org/bot’ + apikey + ‘/ getUpdates’ and receive an array of messages. I walk through that and throw each message through a parser function.
That parser function checks if the message starts with “!”, If so, is it a direct command I use for the events (! Createevent Drinking 10-10-2020 for example. Or! List,! Going Drinking etc).
If it doesn’t start with a “!” does it go to another function that does some “fun” things (which you can’t do with a “command-only” bot), like responding to a message once in a while by throwing it through cleverbot, or at to respond to certain keywords.
I was also very simple to give comments:
request(‘https://api.telegram.org/bot’ + apikey + ‘/sendMessage?chat_id=’ + chatID + ‘&text=” + messageToSend)
Nowadays there are a lot of libraries to manage all of this, but I just put it together for fun.
If you have specific questions let me know