A beginner-friendly Discord bot built with discord.py that demonstrates various command types and server management features.
BotForge25 is an educational Discord bot project designed to help beginners learn Discord bot development. It showcases different command types (prefix, slash, and hybrid commands) and provides examples of interacting with Discord servers, channels, and members.
- Prefix Commands: Traditional commands using
?prefix - Slash Commands: Modern Discord slash commands
- Hybrid Commands: Commands that work both as prefix and slash commands
- Simple greeting commands (Hello World, Bye World, Greet)
- Channel listing (all channels, text channels, by type)
- Targeted message sending to specific channels
- Safe message sending with channel validation
- Server information display (name, ID, member count, owner details)
- Python 3.8 or higher
- A Discord account
- Basic knowledge of Python
-
Clone or download this repository
cd BotForge25 -
Create a virtual environment
Windows:
python -m venv venv venv\Scripts\activate
macOS/Linux:
python3 -m venv venv source venv/bin/activate -
Install dependencies
pip install -r requirements.txt
-
Set up your bot token
- Create a
.envfile in the project root - Add your Discord bot token:
BOT_TOKEN=your_bot_token_here
- Create a
-
Run the bot
python main.py
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section and click "Add Bot"
- Under "TOKEN", click "Reset Token" and copy it
- Enable "MESSAGE CONTENT INTENT" under Privileged Gateway Intents
- Go to OAuth2 → URL Generator
- Select scopes:
botandapplications.commands - Select bot permissions:
Send Messages,Read Messages/View Channels, etc. - Copy the generated URL and use it to invite the bot to your server
| Command | Type | Description | Usage |
|---|---|---|---|
?helloworld |
Prefix | Simple hello world response | ?helloworld |
/byeworld |
Slash | Goodbye message | /byeworld |
?greet or /greet |
Hybrid | Personalized greeting with mention | ?greet |
?allchannels |
Hybrid | Lists all server channels | ?allchannels |
?textchannels |
Hybrid | Lists text channels only | ?textchannels |
?channelsbytype |
Hybrid | Lists channels by type | ?channelsbytype text |
?sendtochannel |
Hybrid | Sends message to specified channel | ?sendtochannel 123456789 |
?channeloptions |
Hybrid | Shows channel details | ?channeloptions #general |
?safesend |
Hybrid | Sends message to channel with validation | ?safesend #general Hello! |
?guildinfo |
Hybrid | Displays server information | ?guildinfo |
all- All channelstext- Text channels onlyvoice- Voice channels onlycategory- Category channels onlystage- Stage channels only
BotForge25/
├── main.py # Main bot code
├── requirements.txt # Python dependencies
├── steps.txt # Setup instructions
├── .env # Environment variables (create this)
├── README.md # This file
└── Guide.md # Beginner's guide
For a detailed beginner's guide on understanding the code and Discord bot concepts, check out Guide.md.
This is an educational project. Feel free to:
- Add new commands
- Improve existing functionality
- Fix bugs
- Enhance documentation
- Never share your bot token publicly
- Always add
.envto your.gitignorefile - Test commands in a private server first
- Enable required intents in the Discord Developer Portal
This project is open source and available for educational purposes.
Bot not responding?
- Check if MESSAGE CONTENT INTENT is enabled
- Verify your bot token is correct
- Ensure the bot has proper permissions in your server
Slash commands not showing?
- Wait a few minutes after starting the bot (Discord syncs globally)
- Check if
await my_bot.tree.sync()is running inon_readyevent
Import errors?
- Make sure virtual environment is activated
- Reinstall dependencies:
pip install -r requirements.txt
For more detailed explanations and tutorials, refer to:
- Guide.md - Comprehensive beginner's guide
- Discord.py Documentation
- Discord Developer Portal
Happy Bot Building! 🚀