A Discord bot built with Python that can moderate servers, play music, run polls, and more. This project demonstrates use of discord.py, SQLAlchemy, and external libraries like yt_dlp.
- Kick and ban members (requires permission)
- Assign roles
- Roll a dice:
!roll - Polls:
!poll "Question" option1 option2 ...
- Join/leave voice channels:
!join,!leave - Play music from YouTube:
!play <url> - Pause, resume, stop:
!pause,!resume,!stop
- Show list of available commands:
!commands - Welcome new members automatically
- Clone this repository:
git clone https://github.com/yourusername/discord-bot.git
cd discord-bot- Create a virtual environment
python -m venv .venv
# Linux / Mac
source .venv/bin/activate
# Windows
.venv\Scripts\activate- install dependencies:
pip install -r requirements.txt
- Get your bot token:
- Go to the Discord Developer Portal
- Create a new application
- Add a bot to the application
- Give Privileged Gateway Intents
- Copy the bot token
- Paste it in
config.json:
{
"DISCORD_TOKEN": "your-bot-token-here"
}