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 ...

Get Automate it! - Recipes to upskill your business now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.