Skip to content

A smart Telegram bot using Telethon with OpenAI chat, YouTube audio and video download, and Wikipedia search features — lightweight, modular, and ready to deploy.

License

Notifications You must be signed in to change notification settings

amitkumar0128/telegram_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Amit Telegram Bot

A powerful, modular Telegram bot built with Python & Telethon.
This bot packs three core features: OpenAI integration, YouTube downloader, and Wikipedia search — all through simple Telegram commands.


🚀 Features

🧠 OpenAI Chat

Chat with an AI powered by OpenAI's GPT model directly in Telegram.
Use it for quick answers, code help, ideas, or just fun convos.

Command Example:

/ask What is the difference between Docker and a virtual machine?

📥 YouTube Audio Downloader

Download YouTube videos as MP3 files and receive them straight in your chat.

Command Example:

/download a <youtube-url> # For only audio
/download v <youtube-url> # For video download

📚 Wikipedia Search

Search Wikipedia and get summarized answers directly in Telegram.

Command Example:

/wiki Elon Musk

🔧 Setup Instructions

1. Clone this repo

git clone https://github.com/yourusername/telegram_bot.git
cd telegram_bot

2. Create a virtual environment

python -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Configure .env file

Create a .env file in the project root:

API_ID=your_telegram_api_id
API_HASH=your_telegram_api_hash
BOT_TOKEN=your_bot_token
OPENAI_API_KEY=your_openai_api_key

📌 You can get your API ID and hash from https://my.telegram.org and your bot token from @BotFather.


5. Run the bot

python -m telegram_bot.main

📁 Project Structure

telegram_bot/
├── plugins/            # Plugin files: chatgpt, yt.dl, wiki
│    ├── chatgpt.py
│    ├── start.py
│    ├── wiki.py
│    └── yt.dl.py
├── utils/              # Plugin loader
├── __init__.py         # Bot initialization
├── __main__.py         # Main entry point
├── .env                # Environment variables
├── requirements.txt
└── README.md

Screenshots

Screenshot

Screenshot Screenshot Screenshot Screenshot

🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you’d like to change.


⚠️ Disclaimer

This bot is for educational purposes only. Download responsibly and respect copyright laws.


📜 License

GPL-3.0 License

About

A smart Telegram bot using Telethon with OpenAI chat, YouTube audio and video download, and Wikipedia search features — lightweight, modular, and ready to deploy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages