pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Telegram Bots with Pharo

PN
Pablo Navarro
Fri, Sep 18, 2020 8:55 PM

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

Github link: https://github.com/pablo1n7/bottlegram

If you use Telegram, do you test an echo bot in https://t.me/echo_pharo_bot

Saludos, Pablo.

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 Github link: https://github.com/pablo1n7/bottlegram If you use Telegram, do you test an echo bot in https://t.me/echo_pharo_bot Saludos, Pablo.
GP
Guillermo Polito
Mon, Sep 21, 2020 12:41 PM

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 pablo1n7@gmail.com escribió:

Hi everyone, I share a tool for creating telegram https://telegram.org/ Bots with Pharo. This library provides an interface for the Telegram Bot API https://core.telegram.org/bots/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

Github link: https://github.com/pablo1n7/bottlegram https://github.com/pablo1n7/bottlegram

If you use Telegram, do you test an echo bot in https://t.me/echo_pharo_bot https://t.me/echo_pharo_bot

Saludos, Pablo.

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 <pablo1n7@gmail.com> escribió: > > Hi everyone, I share a tool for creating telegram <https://telegram.org/> Bots with Pharo. This library provides an interface for the Telegram Bot API <https://core.telegram.org/bots/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 > > Github link: https://github.com/pablo1n7/bottlegram <https://github.com/pablo1n7/bottlegram> > > If you use Telegram, do you test an echo bot in https://t.me/echo_pharo_bot <https://t.me/echo_pharo_bot> > > Saludos, Pablo.
PN
Pablo Navarro
Mon, Sep 21, 2020 2:33 PM

Hi Guille, Thanks for the feedback. It's an excellent idea. I'm going to add the link in the bot in \help or \start.

Saludos, Pablo.
El 21 de sep. de 2020 09:41 -0300, Guillermo Polito guillermopolito@gmail.com, escribió:

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 pablo1n7@gmail.com 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

Github link: https://github.com/pablo1n7/bottlegram

If you use Telegram, do you test an echo bot in https://t.me/echo_pharo_bot

Saludos, Pablo.

Hi Guille, Thanks for the feedback. It's an excellent idea. I'm going to add the link in the bot in \help or \start. Saludos, Pablo. El 21 de sep. de 2020 09:41 -0300, Guillermo Polito <guillermopolito@gmail.com>, escribió: > 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 <pablo1n7@gmail.com> 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 > > > > Github link: https://github.com/pablo1n7/bottlegram > > > > If you use Telegram, do you test an echo bot in https://t.me/echo_pharo_bot > > > > Saludos, Pablo. >