A Discord bot that automatically creates voice channels for events, posts announcements, and manages event lifecycle.
- What Does This Bot Do?
- Requirements
- Setup Guide (Step by Step)
- Configuration Explained
- Commands
- How Events Work
- Features
- Troubleshooting
This bot automates event hosting on your Discord server:
- Someone joins a "lobby" voice channel - This triggers the bot
- Bot picks an event - Either randomly or lets the user choose via DM
- Bot creates a voice channel - Named after the event
- Bot posts an announcement - With event details, image, and a "Join" button
- Bot pings a role - So people know an event is starting
- When everyone leaves - The voice channel is deleted and the event ends
It's like having an automated event manager that handles all the boring stuff.
- Python 3.8 or higher - Download from python.org
- A Discord Bot Token - You'll create this on the Discord Developer Portal
- A Discord Server - Where you have admin permissions
- Go to the Discord Developer Portal
- Click "New Application" (top right)
- Give it a name (like "Event Bot") and click Create
- Go to the "Bot" tab on the left sidebar
- Click "Reset Token" and copy the token - SAVE THIS SOMEWHERE SAFE
- Scroll down and enable these Privileged Gateway Intents:
SERVER MEMBERS INTENT- ONMESSAGE CONTENT INTENT- ON
- Still in the Developer Portal, go to "OAuth2" > "URL Generator"
- Under SCOPES, check:
botapplications.commands
- Under BOT PERMISSIONS, check:
Manage ChannelsSend MessagesEmbed LinksAttach FilesRead Message HistoryMention EveryoneMove MembersConnectManage Roles(for channel permissions)
- Copy the generated URL at the bottom
- Paste it in your browser and select your server
You need to enable Developer Mode in Discord to copy IDs:
- Open Discord Settings (gear icon)
- Go to "Advanced"
- Turn on "Developer Mode"
Now you can right-click on things and select "Copy ID":
- Server ID: Right-click your server name > Copy Server ID
- Channel IDs: Right-click a channel > Copy Channel ID
- Role IDs: Server Settings > Roles > Right-click a role > Copy Role ID
- Open
config.yamlin a text editor (Notepad, VS Code, etc.) - Fill in your values:
bot:
token: "PASTE_YOUR_BOT_TOKEN_HERE"
server:
guild_id: 123456789012345678 # Your server ID
lobby_channel_id: 123456789012345678 # Voice channel that triggers events
announcement_channel_id: 123456789012345678 # Text channel for announcements
config_editor_channel_id: 123456789012345678 # Admin channel for live config editing
settings:
max_concurrent_events: 1 # How many events can run at once
cooldown_seconds: 300 # Seconds between events (300 = 5 minutes)
generated_vc_user_limit: 0 # Max users in event VC (0 = unlimited)
pm_selection_mode: false # false = random event, true = user picks via DM
pm_selection_timeout: 60 # Seconds to wait for DM response
auto_cleanup: false # If true, deletes event embeds when event ends
admin_role_ids:
- 123456789012345678 # Role ID that can use admin commands
events:
- name: "Your Event Name"
description: "What this event is about"
role_id: 123456789012345678 # Role to ping when this event starts
color: "#FFD700" # Hex color for the embed
images:
- "./images/your_image.jpg" # Local image in images folder- Put your event images in the
imagesfolder - Reference them in config as
./images/filename.jpg - Supported formats: JPG, PNG, GIF, WEBP
Open a terminal/command prompt in the bot folder and run:
pip install -r requirements.txtpython bot.pyYou should see:
[INFO] Bot logged in as YourBotName#1234
[INFO] Slash commands synced!
[INFO] Bot is ready!
bot:
token: "YOUR_TOKEN_HERE"Your bot's secret token. NEVER share this with anyone!
server:
guild_id: 123456789012345678
lobby_channel_id: 123456789012345678
announcement_channel_id: 123456789012345678
config_editor_channel_id: 123456789012345678| Setting | What It Does |
|---|---|
guild_id |
Your Discord server's ID |
lobby_channel_id |
The voice channel users join to start an event |
announcement_channel_id |
Text channel where event announcements are posted |
config_editor_channel_id |
Text channel where admins can edit config live (optional) |
settings:
max_concurrent_events: 1
cooldown_seconds: 300
generated_vc_user_limit: 0
pm_selection_mode: false
pm_selection_timeout: 60
auto_cleanup: false
admin_role_ids:
- 123456789012345678| Setting | What It Does |
|---|---|
max_concurrent_events |
How many events can run at the same time |
cooldown_seconds |
Wait time between events (prevents spam) |
generated_vc_user_limit |
Max users in event voice channel (0 = unlimited) |
pm_selection_mode |
false = random event, true = user chooses via DM |
pm_selection_timeout |
How long to wait for DM response before canceling |
auto_cleanup |
false = post "Event Ended" embed, true = delete embed entirely |
admin_role_ids |
List of role IDs that can use admin commands |
events:
- name: "Event Name"
description: "Event description"
role_id: 123456789012345678
color: "#FFD700"
images:
- "./images/image1.jpg"
- "./images/image2.jpg"| Setting | What It Does |
|---|---|
name |
The event's display name |
description |
Text shown in the announcement embed |
role_id |
Which role gets pinged when this event starts |
color |
Hex color code for the embed sidebar (like #FF0000 for red) |
images |
List of images - one is randomly picked per event |
Adding More Events: Just copy the event block and paste it below!
events:
- name: "Event One"
description: "First event"
role_id: 111111111111111111
color: "#FF0000"
images:
- "./images/event1.jpg"
- name: "Event Two"
description: "Second event"
role_id: 222222222222222222
color: "#00FF00"
images:
- "./images/event2.jpg"All commands are slash commands. Type / in Discord to see them.
| Command | What It Does |
|---|---|
/help |
Shows all commands and how the bot works |
/eventinfo |
Shows currently active events |
| Command | What It Does |
|---|---|
/generateevent |
Manually create an event (DMs you to pick which one) |
/mode 1 |
Set to random selection mode (default) |
/mode 2 |
Set to PM selection mode (user picks via DM) |
/lockevent |
Lock/unlock the lobby channel (prevents new events) |
Note: Admin commands require your role to be listed in admin_role_ids in the config.
Mode 1 - Random Selection (Default):
- User joins the lobby voice channel
- Bot picks a random event from the config
- Event starts immediately
Mode 2 - PM Selection:
- User joins the lobby voice channel
- Bot sends them a DM with a dropdown menu
- User picks which event they want to host
- Event starts after selection
- A voice channel is created (named after the event)
- The triggering user is moved to the new channel
- An announcement is posted with:
- Event name and description
- A random image from that event's image list
- "Join Event" button - moves clickers to the voice channel
- "Create Team VCs" button - creates Team 1 and Team 2 channels
- When ALL users leave the event voice channel(s)
- The voice channel(s) are deleted
- The announcement is updated to show "Event Ended"
- Cooldown timer starts
When someone clicks "Create Team VCs":
- The main event channel is renamed to "Team 1"
- A new "Team 2" channel is created
- The event only ends when BOTH channels are empty
- Users can move between Team 1 and Team 2 without ending the event
Admins can edit the bot configuration without restarting:
- Go to your config editor channel
- Paste YAML configuration (with or without ```yaml code blocks)
- Bot validates and applies the changes
- A preview embed shows the current config
Important:
- The bot token is hidden in the preview (shows as
***HIDDEN***) - You cannot change the token via Discord (security feature)
- Your message is deleted immediately after processing
Prevents event spam:
- After an event starts, new events are blocked for X seconds
- Users who try to start events during cooldown get a DM explaining the wait time
- Admins using
/generateeventbypass the cooldown
If multiple people join the lobby at the exact same time:
- Only the first person triggers an event
- Others get a message saying "An event is already being created"
- No duplicate events or DM spam
Admins can lock/unlock the lobby channel:
/lockeventtoggles the lock- When locked, users can't join the lobby (prevents all events)
- Useful for maintenance or scheduled downtime
"Please set your bot token in config.yaml!"
- You forgot to add your bot token, or it's still set to the placeholder
Token is invalid
- Go back to the Discord Developer Portal and reset your token
- Copy the new token carefully (no extra spaces)
Wait a minute - Discord can take up to an hour to sync commands globally
Check bot permissions:
- Make sure you invited the bot with
applications.commandsscope - Re-invite the bot using the URL from Step 2
Check your channel ID:
- Make sure
lobby_channel_idis a VOICE channel, not a text channel - Verify the ID is correct (right-click > Copy ID)
Check the logs:
- The bot logs to
eventbot.logand console - Look for "Voice state update" messages
The bot needs these permissions:
- Manage Channels - to create/delete voice channels
- Move Members - to move users to event channels
- Send Messages - to post announcements
- Embed Links - to send rich embeds
- Attach Files - to send local images
- Mention Everyone - to ping roles
For local images:
- Make sure the file exists in the
imagesfolder - Check the path in config (should be
./images/filename.jpg) - File names are case-sensitive on some systems
For URL images:
- Make sure the URL is a direct link to an image
- The URL must be publicly accessible
"You don't have permission"
- Your role isn't in
admin_role_ids - Add your role ID to the config
YAML errors
- Check your YAML syntax (indentation matters!)
- Use a YAML validator online to check for errors
- Delete the old preview messages manually
- The bot will now track and update a single preview message
eventbot/
├── bot.py # Main bot code
├── config.yaml # Your configuration
├── requirements.txt # Python dependencies
├── eventbot.log # Log file (created when bot runs)
├── README.md # This file
└── images/ # Your event images
├── image1.jpg
├── image2.jpg
└── ...
If you're stuck:
- Check the
eventbot.logfile for error messages - Make sure all IDs in config are correct
- Verify the bot has all required permissions
- Restart the bot after config changes (unless using live editor)
| What You Want | How To Do It |
|---|---|
| Start an event | Join the lobby voice channel |
| Choose which event | Set pm_selection_mode: true in config or use /mode 2 |
| Add more events | Copy an event block in config and edit it |
| Change cooldown | Edit cooldown_seconds in config |
| Stop all events | Use /lockevent to lock the lobby |
| See active events | Use /eventinfo |
| Edit config live | Paste YAML in the config editor channel |