A Discord bot that splits people up in voice channels for some random chat time
The main idea here is to have a Discord bot that can be used at social events (e.g. coffee breaks at an online conference) to foster random conversations and networking.
You need Python 3.6 or later.
Install dependencies with pip
and run the bot:
% pip install -r requirements
% BOT_TOKEN=XYZ VOICE_CHANNEL_CAT="your category" python3 ./bot.py
You will have to invite the bot to your server and give it the necessary permissions (see below).
The bot can be configured using environment variables. Some are required, some are optional with sane defaults:
- CHAT_BOT_SECRET: your Discord Bot token/secret.
- CHAT_VOICE_CAT: the name of the voice channel category on your server. People will be invited to voice channels under this category.
- CHAT_NUM_PARTICIPANTS: maximum number of participant per voice channel. Defaults to 5. A voice channel with frewer than CHAT_NUM_PARTICIPANTS members is considered available.
- CHAT_CHANNEL_ID: if defined, the bot will only listen for commands in this channel. Defaults to None (i.e. the bot will listen in all channels).
- CHAT_HELP_DELAY: the bot will send its help message every CHAT_HELP_DELAY seconds. Defaults to 600 (i.e. 10 minutes).
- CHAT_CREATE_CHANNELS: if defined at all, the bot will create channels if none are available.
The bot will need, at a minimum, permission to:
- Listen to messages.
- Send messages to members.
- Create voice channels (if needed, see above).