Assign Roles Command Documentation
Overview
The /assignroles command starts a new game by reading all members of a Discord role and assigning them game roles from a chosen template. It creates the game and gives you a link to the Game Setup page where you can configure players, roles, and affiliations before starting.
Moderator only: This command requires the server's configured moderator role.
/assignroles Command
Spin the wheel and assign roles to all players in a Discord role.
Required Arguments
┌───────────────┬────────┬────────────────────────────────────────────────────────┐
│ Argument │ Type │ Description │
├───────────────┼────────┼────────────────────────────────────────────────────────┤
│ roletemplates │ Choice │ The set of roles to load into the game │
│ playerrole │ Role │ Discord role whose members become the players │
│ modrole │ Role │ Discord role for moderators (excluded from the game) │
└───────────────┴────────┴────────────────────────────────────────────────────────┘
Optional Arguments
┌────────────────┬──────┬────────────────────────────────────────────────┬─────────┐
│ Argument │ Type │ Description │ Default │
├────────────────┼──────┼────────────────────────────────────────────────┼─────────┤
│ deadplayersrole│ Role │ Discord role to assign to players when they die│ None │
└────────────────┴──────┴────────────────────────────────────────────────┴─────────┘
Role Templates
┌──────────────────────┬───────────────────────────────────────────────────────────┐
│ Template │ Description │
├──────────────────────┼───────────────────────────────────────────────────────────┤
│ WEREWOLF │ Werewolf default roles │
│ MAFIA │ Mafia default roles │
│ SPN_3 │ Supernatural season 3 roles │
│ SPN_4 │ Supernatural season 4 roles │
│ NUTCRACKER │ Nutcracker roles │
│ BROKEN_SAFE_ZONE │ Broken Safe Zone roles │
│ SPN_MAFIA │ Supernatural Mafia roles │
│ MYTHOS_UNRAVELED │ Mythos Unraveled roles │
│ IMPORT_FROM_CHANNEL │ Import roles from the current channel's messages │
│ IMPORT_FROM_SERVER │ Import roles from Discord channel categories on the server│
└──────────────────────┴───────────────────────────────────────────────────────────┘
Note:
IMPORT_FROM_CHANNELreads the messages in the channel where the command is run and parses them as role definitions. See theIMPORT_FROM_CHANNELFeature section below for format details.
Note:
IMPORT_FROM_SERVERopens an interstitial web page where you choose which channel categories to import. See theIMPORT_FROM_SERVERFeature section below for details.
Prerequisites
- No active game: If a game is already in progress, the command will fail and ask you to run
/cleanupgamefirst. - Bot permissions: The bot needs
ViewAuditLog,ViewChannel,ManageChannels,ManageRoles, andSendMessagespermissions. You can use the/testpermissionscommand for more comprehensive permissions feedback. - Moderator role: You must have the server's configured moderator role.
Restrictions
- Only one game can be active at a time per server
- The
playerroledetermines exactly who becomes a player — all members with that role are included - Players are sorted alphabetically (with Unicode normalization for accented names) before role assignment
- Running this command clears all previous game data and deregisters any active message monitoring triggers
Examples
Standard Werewolf game:
/assignroles roletemplates:WEREWOLF playerrole:@Players modrole:@Moderators
Mafia game with a dead players role:
/assignroles roletemplates:MAFIA playerrole:@GameMembers modrole:@Mods deadplayersrole:@Dead
Custom roles imported from the current channel:
/assignroles roletemplates:IMPORT_FROM_CHANNEL playerrole:@Players modrole:@Moderators
What Happens When You Run /assignroles
- Permissions are checked — the bot verifies it has the necessary Discord permissions and that you have the moderator role.
- Existing game check — if a game is already active, the command stops and tells you to run
/cleanupgamefirst. - Previous game data is cleared — all stored game data and active message monitoring triggers for the server are reset.
- Players are collected — all Discord members with the
playerroleare fetched and sorted alphabetically. - Roles are loaded — either from the chosen built-in template, parsed from the channel (for
IMPORT_FROM_CHANNEL), or selected via the category picker interstitial (forIMPORT_FROM_SERVER). - Game is created — the bot creates the game on the server and sets up private player channels.
- Game Setup link is returned — a private (ephemeral) response gives you a link to the Game Setup page where you can configure and start the game.
Note: The response is only visible to you (ephemeral). Open the link to configure the role assignment and spin the wheel.
IMPORT_FROM_CHANNEL Feature
When you select IMPORT_FROM_CHANNEL, the bot reads up to 2000 previous messages in the current channel and parses them as role definitions. This lets you define fully custom roles without using a built-in template.
How to Format Roles
Post one or more messages in the channel before running the command. Use markdown headers to structure your roles:
# Team Name
## Role Name
🐺 (Must be a standard emoji. Discord custom emojis are not supported.)
Role description goes here. Can span multiple lines and can include uploaded media.
## Another Role Name
Optional description.
Formatting rules:
# Team Name— Sets the affiliation for all roles that follow (until the next#).## Role Name— Starts a new role definition under the current team.- Emoji (optional) — A single, standard emoji on the line immediately after
## Role Nameis used as the role's icon. Custom emojis are not supported. - Description — All text and media after the emoji (or role name if no emoji) until the next
#or##becomes the role's description.
Note: The emoji line must be a single emoji character or Discord custom emoji. If the bot cannot identify it as an emoji, the line will be treated as the start of the description instead.
Example Channel Format
Post a message like this in the channel, then run the command:
# Village
## Seer
🔮
The Seer can investigate one player each night to learn their alignment.
## Doctor
💊
The Doctor can protect one player each night from being eliminated.
## Villager
An ordinary villager with no special abilities.
# Werewolves
## Alpha Wolf
🐺
The Alpha Wolf leads the pack and chooses who to eliminate each night.
## Moon Moon
🌙
The very best wolf who ever was or will be.
Then run:
/assignroles roletemplates:IMPORT_FROM_CHANNEL playerrole:@Players modrole:@Moderators
With Images and Attachments
You can post messages that include image attachments (e.g., role art). The bot will capture a reference to the image and forward it alongside the role description when it sends role assignments to players.
Validation
If no roles are found in the channel messages, the command will fail and show this reminder about the expected format:
# Team Name ← affiliation (H1)
## Role Name ← role name (H2)
<emoji> ← optional emoji on the next line
Description text ← description follows
IMPORT_FROM_SERVER Feature
When you select IMPORT_FROM_SERVER, the bot creates the game and gives you a link to a category picker page instead of going directly to Game Setup.
How It Works
Run the command —
/assignroles roletemplates:IMPORT_FROM_SERVER ...creates the game and returns an ephemeral link.Open the category picker — the page lists all channel categories on your server that contain at least one text channel. Each category has a checkbox and an expandable list of its text channels.
Select categories — tick the categories whose text channels should become roles. Each text channel becomes one role; the category it belongs to becomes its affiliation.
Choose a channel setup mode — once you have selected at least one category, a Channel Setup section appears:
- Create new channels — the bot copies the selected channels by name and creates fresh private role channels for players. The originals are untouched.
- Reuse existing channels — the bot renames the existing channels and updates their permissions directly, placing players into those channels for the game.
If fewer channels are selected than there are players, the bot must create new channels (one per player), so the reuse option is locked.
Continue to Game Setup — clicking the button fetches the first 60 messages from each selected channel to populate role descriptions, then opens the standard Game Setup page with affiliations and roles pre-filled.
Note: When using
IMPORT_FROM_SERVER, you must make sure you select the team channel and extra channels options that are appropriate for your game.
How Role Data Is Populated
- Channel name (after stripping leading emoji and
-separator) - Role name - Leading Unicode emoji in channel name - Role emoji
- First 60 messages in the channel (oldest first) - Role description
- Category name - Affiliation
Images and file attachments in those messages are captured as media references and forwarded to the player's private channel when the game starts, the same way IMPORT_FROM_CHANNEL handles attachments.
Example
Your server has a category called Werewolves containing channels 🐺-alpha-wolf, 🌙-moon-moon, and a category called Village containing 🔮-seer, 💊-doctor. Selecting both categories creates four roles — Alpha Wolf and Moon Moon in the Werewolves affiliation, Seer and Doctor in the Village affiliation — and uses the channel descriptions to populate each role's text.
/assignroles roletemplates:IMPORT_FROM_SERVER playerrole:@Players modrole:@Moderators
Using the Game Setup Page
After running /assignroles, open the link from the ephemeral reply. The Game Setup page lets you configure the game before starting it. The page has several sections:
Affiliations
Affiliations are the teams in the game (e.g., Village and Werewolves). The template pre-populates affiliations based on the roles it contains. You can add, remove, and configure them here.
Each affiliation has two optional toggles:
- Team chat — creates a private channel visible only to players in that affiliation during the game
- Extra channels — only available when team chat is enabled; creates additional roster, voting, and kill notes channels for that team
You can also add entirely new affiliations by entering a name, picking a color, and optionally enabling team chat. At least two affiliations must always exist.
Players
A read-only list of all players pulled from the playerrole Discord role, shown with their avatars, display names, and usernames. This list cannot be changed here — adjust the Discord role before running /assignroles if you need to add or remove players.
Roles Configuration
A grid of all roles from the chosen template. For each role you can:
- Set the count — use the
−and+buttons to set how many copies of that role appear in the game (0–99). The+button disables automatically once total roles equals total players. - Set the affiliation — use the dropdown to assign the role to a team. This controls which team chat channel the player receives.
Use the search bar at the top to filter roles by name.
Key rule: Total roles must equal total players before the Start Game button becomes active. The Game Summary section at the bottom tracks this in real time.
Custom Roles
Create one-off roles that aren't in the template. Enter a name (up to 30 characters) and an optional description (up to 200 characters), then click + Add Custom Role. The new role appears in the Roles Configuration grid and can be counted and assigned to an affiliation like any template role.
Pin Player Assignments
Guarantee specific players receive specific roles. Click + Add Pin Assignment, then choose a player and a role from the dropdowns. The role must have a count of at least 1. The bot will assign that role to that player when starting the game, and fill remaining slots randomly. Any pinned players will be listed in the game log for post-game transparency.
Note: A player can only be pinned once. Duplicate pins are flagged with a conflict warning and will block the game from starting.
Message Monitoring
Optionally enable monitoring of message edits and deletes in player and team channels during the game. When enabled:
- Grace period — edits and deletes within this window (0–999 minutes, default 3) are still logged but do not ping moderators. This allows players to quickly fix typos without triggering alerts.
- Monitor player and team channels — when checked, monitoring applies to all bot-created player and team channels.
Player Action System
Optionally enable a structured system for tracking player abilities each phase. When enabled, you can configure:
- Priorities — the order in which actions resolve (e.g., Redirections before Kills). Click the up and down buttons to reorder. Defaults: Redirections, Roleblocks, Protections, Investigations, Kills, Aftermath.
- Categories — labels for organizing abilities (e.g., Day Action, Night Action). Defaults: Day Action, Night Action, Other.
Game Summary
A live breakdown at the bottom of the page showing total players, total roles, and per-team role counts. A floating scorecard follows you as you scroll to keep these counts visible while configuring roles. The validation message tells you whether the configuration is ready:
- Configuration valid! Ready to start. — player and role counts match
- Mismatch: N players but M roles. — adjust role counts until they match
Starting the Game
Once the Game Summary shows the configuration is valid, click Start Game. The bot will randomly assign roles to players (respecting any pinned assignments), create all configured Discord channels, and set permissions on each role and team channel. On success, the page shows a confirmation screen and you can return to Discord.
Tips and Best Practices
Player Role Setup
- Create a dedicated Discord role (e.g.,
@Players) and assign it only to game participants before running/assignroles - The bot reads the role at the time of the command — add or remove members from the role before running it, not after
- Use
modroleto keep moderators out of the player list even if they share other roles
Dead Players Role
- Providing
deadplayersroleallows the/deathmanagementcommand to automatically assign and remove this role as players die and are revived - Without it, death tracking still works but the Discord role won't be updated automatically
Template vs. Import
- Built-in templates are best for standard games where the role set matches a known format
IMPORT_FROM_CHANNELis best for custom or one-off games where roles are defined as text in a Discord channelIMPORT_FROM_SERVERis best when role definitions already live in organized channel categories on your server- When using
IMPORT_FROM_CHANNEL, the number of roles in your channel must match the number of players for assignment to succeed
Starting Fresh
- Always run
/cleanupgamebefore starting a new game —/assignroleswill refuse to run if a game is already active - Running
/cleanupgameremoves all bot-created channels and resets all game state, including all shop data
Managed Games
/managedgame is an alternative to /assignroles where the bot does the game bookkeeping itself. It takes the same three role arguments (playerrole, modrole and deadplayersrole, all required) and replies with a private setup link. Managed games are in limited testing and only available to allow-listed users; see the Game Utility Commands page.
/cleanupgame Command
Delete all channels created by the bot, clear all game data, and clear all shop data for the server.
Moderator only: This command requires the server's configured moderator role.
Arguments
This command takes no arguments.
How It Works
Running /cleanupgame does not delete anything immediately. Instead, it:
- Searches the server's audit log for channel creation events performed by the bot (up to the last 100 entries).
- Displays a confirmation embed listing all bot-created channels that still exist, along with their types (Text or Category), any reused channels that will be cleaned, and a reminder that shop data will be wiped.
- Presents a Confirm channel cleanup button.
Clicking the button performs the actual cleanup:
- Deletes bot-created channels — text channels and category channels the bot created for this game are permanently deleted. All messages within those channels are lost.
- Cleans reused channels — channels that were reused from
IMPORT_FROM_SERVER(i.e. they appear in game data but were not created by the bot) are not deleted. Instead, the player's permission overwrite is removed and the player's name is stripped from the end of the channel name, restoring the channel name to its original form. Any chat from the player will remain in that channel. - Clears the message monitoring cache — any cached messages stored for monitoring purposes are purged.
- Resets game state — all stored game data (
game-infosub-config) is cleared. - Deregisters message monitoring triggers — any active edit/delete monitors set up during the game are removed.
- Wipes all shop data — shops, items, currencies, player balances and inventories, tags, betting events, auctions, trades and the full ledger are permanently deleted, and shop settings (income modules, log channels, trading) reset to defaults. See the Shop moderator guide.
A results embed is shown afterward with counts of deleted channels, cleaned reused channels, and any failures.
Managed Games
If a managed game is running instead of a classic game, the confirmation embed reads Clean Up Managed Game. Confirming ends the game immediately and marks it abandoned; engine state is kept for the record, and shop data is wiped the same way.
Confirmation Timeout
The confirmation button expires 10 minutes after the command is run. If you don't click it within that window, you'll need to run /cleanupgame again.
Restrictions
- The bot identifies its own channels using the server's audit log, which covers only the most recent channel creation events. Channels created a long time ago may not appear and will not be deleted.
- If no bot-created channels are found, the confirmation embed says so and no channels are deleted, but game state is still reset on confirmation.
Example
/cleanupgame
The bot responds with a private embed listing channels to delete. Click Confirm channel cleanup to proceed.