O'Reilly logo

Automate it! - Recipes to upskill your business by Chetan Giridhar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a moody Telegram bot

Before we start developing a bot, we should be clear about our objectives: what is my bot going to do? We take a simple example of creating a bot that would respond with an emoji based on the user's mood. It's a moody bot for the simple reason that it represents the mood of the user. Sounds like an interesting use case? Let's go for it!

In this recipe, we shall use the python-telegram-bot (https://github.com/python-telegram-bot/) library to develop a Telegram bot. So, let's get started by first installing the python-telegram-bot module with our favorite utility, namely python pip:

(bots)chetans-MacBookPro:ch09 Chetan$ pip install python-telegram-bot --upgrade Collecting python-telegram-bot Downloading python_telegram_bot-5.1.0-py2.py3-none-any.whl ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required