Skip to content

FFMOC/bot-hello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Quote Bot (pyTelegramBotAPI)

A simple Telegram bot built with pyTelegramBotAPI (telebot).
It responds to basic commands and can send a random quote from quotes.csv.


Features

  • /start → Greets the user.
  • /help → Lists available commands.
  • /quote → Sends a random quote and its author from quotes.csv.
  • Echo mode: replies with You write: ... to any other message.

If quotes.csv is missing or empty, the bot sends an error message.


Requirements

  • Python 3.10+
  • A Telegram bot token (from @BotFather)

Install dependencies from requirements.txt:

pip install -r requirements.txt

Configuration

The bot token is stored in a .env file:

BOT_TOKEN=123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

Do not commit .env to GitHub (already excluded via .gitignore).


Usage

Start the bot locally:

python main.py

Example session in Telegram:

User: /start
Bot: Hi!

User: /help
Bot: Commands: /start, /help, /quote

User: /quote
Bot: "The world as we have created it is a process of our thinking…" — Albert Einstein

Project Structure

telegram-quote-bot/
├─ main.py
├─ quotes.csv
├─ requirements.txt
├─ .env (not committed)
├─ .gitignore
└─ README.md

Notes & Recommendations

  • Make sure quotes.csv exists and has at least one row (Quote,Author).
  • For deployment, consider:
    • Running on a server with systemd / pm2.
    • Using Docker for containerized deployment.
    • Switching to aiogram for async scaling.
  • Always keep your bot token secret.

License

MIT

About

A simple Telegram bot built with **pyTelegramBotAPI (telebot)**. It responds to basic commands and can send a random quote from `quotes.csv`.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages