Skip to content

dkoleev/telegram-bots

Repository files navigation

Telegram Bots on Python

Table of Contents

What is a Telegram Bot

Bots are small applications that run entirely within the Telegram app. Users interact with bots through flexible interfaces that can support any kind of task or service.

You can read more about bots in the official documentation:
Bots
Telegram Bot API

Demo bots from python-telegram-bot Examples

My Bots

This bot shows phonetic, meaning, and pronunciations for entered words.

How to use:

  1. Find this bot in Telegram by the name @WordExplainBot.
  2. Enter the word you need the explanation in the chat with the bot.

How it works:

This bot uses Free Dictionary API.

After getting a message from a user, the bot sends the request to Free Dictionary API

def get_meaning(word):
    url = f'https://api.dictionaryapi.dev/api/v2/entries/en/{word}'
    r = requests.get(url)
    if r.status_code == 200:
        data = r.json()
        return format_respone(data)
    else:
        return f"Sorryy, I couldn't find the meaning of '{word}'."

Parse the result and send it back to the user.

Host bots

You can host your bots on a third-party host or your own.

Third-party hosts

There are many choices for hosts. For example:

  • Heroku
  • PythonAnywhere
  • AWS (Amazon Web Services)
  • Google Cloud Platform

I'd recommend you start with PythonAnywhere because of its simplicity and free plan.

Own host

I use Raspberry Pi 5 for hosting my bots.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages