A comprehensive Telegram bot designed to handle FedBan appeals and Fed Admin requests with an intuitive user interface and robust admin management system.
- Dual Appeal Types: Support for FedBan unban appeals and Fed Admin requests
- Interactive Interface: User-friendly inline keyboards for seamless navigation
- Database Management: SQLite database for persistent appeal storage
- Admin Notifications: Real-time notifications to administrators
- Status Tracking: Comprehensive appeal status management
- Error Handling: Robust error handling and logging
- Template Guidance: Built-in templates to help users write effective appeals
- Python 3.7+
- pip package manager
- Install Packages
sudo apt update && sudo apt install -y git python3 python3-venv python3-pip && sudo apt install python3- Clone the repository
git clone https://github.com/real-ekansh/Fedbot
cd Fedbot- Install dependencies
pip install -r requirements.txt- Create environment file snd Activate it
python -m venv venv
source venv/bin/activate-
Configure environment variables (see Configuration section)
-
Run the bot
python fedbot.pyCreate a .env file in the project root with the following variables:
BOT_TOKEN=your_telegram_bot_token_here
ADMIN_ID=your_telegram_admin_user_id
DB_PATH=appeals.db (defualt path)| Variable | Description | Required |
|---|---|---|
BOT_TOKEN |
Telegram Bot API token from @BotFather | β |
ADMIN_ID |
Telegram user ID of the administrator | β |
DB_PATH |
Path to SQLite database file | β (default: appeals.db) |
The bot uses SQLite with the following table structure:
CREATE TABLE appeals (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
username TEXT,
appeal_type TEXT NOT NULL,
appeal_text TEXT,
status TEXT DEFAULT "pending",
timestamp TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);| Command | Description |
|---|---|
/start |
Welcome message and bot introduction |
/appeal |
Start the appeal process with type selection |
| Command | Description |
|---|---|
/pending |
View all pending appeals |
/approve <appeal_id> |
Approve a specific appeal |
/reject <appeal_id> |
Reject a specific appeal |
- Start the bot: Send
/startto receive a welcome message - Submit an appeal: Send
/appealand select your appeal type:- π Fed Unban Appeal: For requesting removal of FedBan
- π Fed Admin Request: For requesting Fed Admin status
- Write your appeal: Follow the provided template and guidelines
- Wait for review: Your appeal will be reviewed by an administrator
1. Why were you banned?
2. What have you learned from this experience?
3. Why should we unban you?
4. Any additional information?
1. Why do you want to be an admin?
2. What experience do you have?
3. How will you help the community?
4. Any additional information?
- Monitor appeals: Receive real-time notifications for new appeals
- Review pending appeals: Use
/pendingto see all pending appeals - Process appeals: Use
/approve <id>or/reject <id>to process appeals
python-telegram-bot>=13.0
python-dotenv>=0.19.0
telegram-appeals-bot/
βββ bot.py # Main bot application
βββ appeals.db # SQLite database (auto-created)
βββ .env # Environment variables
βββ .env.example # Environment template
βββ requirements.txt # Python dependencies
βββ README.md # This file
The bot implements comprehensive logging with the following levels:
- INFO: General operational information
- ERROR: Error conditions and exceptions
- WARNING: Warning conditions
Logs include timestamps, logger names, and detailed error messages for debugging.
- Configuration Validation: Validates required environment variables on startup
- Database Error Handling: Graceful handling of SQLite connection issues
- Telegram API Errors: Proper handling of Telegram API exceptions
- User Input Validation: Validates user inputs and appeal types
- Admin Access Control: Restricted admin commands to authorized users only
- Input Sanitization: Proper handling of user inputs
- Error Isolation: Prevents error propagation that could crash the bot
- Database Security: Safe database operations with parameterized queries
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any bugs or issues, please report them through the GitHub issues page with:
- Detailed description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Log messages (if applicable)
For support and questions:
- Create an issue on GitHub
- Check the documentation
- Review the logs for error messages
- Contact on Telegram
- Discussion in the official telegram chat [en]
If you liked my Work please give my Project a Star β
Made with β€οΈ for the Telegram community

