Skip to content

chaychoong/example-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-bot

A Telegram bot built for a Git workshop. Each slash command lives in its own file — add yours by opening a PR!

Setup

  1. Create a bot via @BotFather on Telegram
  2. Copy the token
cp .env.example .env
# paste your token into .env

Running

uv run bot.py

Or with an env file:

uv run --env-file .env bot.py

Adding a command

Create a new file in commands/:

# commands/yourname.py

DESCRIPTION = "What your command does"


async def handle(message: dict, bot) -> None:
    await bot.reply(message, "your response here")

That's it. The bot discovers it automatically at startup.

Commands

Command Description
/start Show available commands
/ping Check if the bot is alive
/about Learn about this bot

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages