Re: Telegram Bots with Pharo
Posted by
Guillermo Polito on
Sep 21, 2020; 12:41pm
URL: https://forum.world.st/Telegram-Bots-with-Pharo-tp5122153p5122301.html
Hi Pablo!
Really nice!
I tested it the other day. It would be nice if the bot had a link to its github repository and the framework’s repo so people could follow from there ;)
Cheers,
Guille
El 18 sept 2020, a las 22:55, Pablo Navarro <
[hidden email]> escribió:
Hi everyone, I share a tool for creating telegram Bots with Pharo. This library provides an interface for the Telegram Bot API.
To create our telegram bot in Pharo, the first thing we need to do is to create a new object that inherits from Bottlegram. This object must define at least these three methods:
- slashStart: to be executed when the bot receives /start.
- slashHelp: to be executed when the bot receives /help.
- defaultText: to be executed when the bot receives an unknown command.
The tool allows creating bots using two methods:
- Using polling: the bot check updates for an amount of time.
- Using webhook: Use this method to create a Teapot server to receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we received an HTTPS POST request to the specified URL