A helper for social-deduction games hosted on Discord
Support Server - Join for help with the bot!
This bot runs on discord.py
Invite Link, it's recommended to not remove any permissions, as some or all commands may stop working
-
Create a bot account in the Discord Dev portal and invite it to your server. - Guide
-
Enable member and message intents - Example
-
Install the latest version of python if you don't have it already. - Download
-
Download the source code either by using the "Download ZIP" option or running
git clone https://github.com/DoggieLicc/discord-sdg-helper
- Open a terminal/command prompt in the
discord-sdg-helper
folder - Create a virtual environment:
python -m venv .venv
- Activate the virtual environment:
.venv\Scripts\activate
(command prompt) orsource ./.venv/bin/activate
(linux) - Install requirements:
pip install -r requirements.txt
- Create a file named
.env
- Edit it and add
BOT_TOKEN=<token>
where<token>
is the bot's token you got from step 1, then save - Run the main script:
python main.py
orpython3 main.py
- Sync the application commands by the text command
sdg.sync
in a channel the bot has access to
BOT_TOKEN
- The bot token to run on (Required)DO_FIRST_SYNC
- If set to true, will run command sync on startupDEVELOPMENT_GUILD
- ID of guild to sync commands toGUIDE_CHANNEL_ID
- ID of forum to read guides fromPROMETHEUS_PORT
- Port to serve Prometheus metrics onDISABLE_PROMETHEUS
- Set totrue
to disable Prometheus metricsDATABASE_FILENAME
- Name of database file. Defaults toguild_info.db
This bot uses the slash commands system provided by Discord. Type /
to see the available commands
To use this function, right-click/tap on a message, and click "Generate Rolelist Roles" under Apps Before using this, make sure all your factions and subalignments are defined properly
% - Role
$ - Faction (You can also use #forum)
(no symbol is for forum tags)
ANY - No filter, case-sensitive (dont combine with ! ...)
& - Seperator
| - Union (Roles only have to be part of atleast one of the unioned filters)
! - Negation (Will negate the next filter's roles)
Lines starting with + will apply to all slots, except slots starting with -
Examples:
%Jailor
- Gets Jailor role
Town Killing
- Gets role with the Town Killing forum tag
$Town
- Gets role from the Town faction
!Dogflummery
- Gets any role that doesnt have Dogflummery forum tag
$Coven&Balanced
- Gets any Coven role with Balanced tag
Town Power|Town Killing!Dogflummery&Reworked
- Get any role that has either the Town Power or Town Killing tag, and doesn't have Dogflummery tag, and has the Reworked tag
+!Dogflummery|!Cursed
- Global filter that makes all slots generate roles that dont have the Doglummery or Cursed tag
-ANY
- Get any role, without applying global filters
Modifiers change how all slots generate in unique ways.
Modifiers start with ?
and can have arguments separated by :
- limit:filters:amount
Limits the amount of the filtered roles that can generate. If the filters correspond to multiple roles, the limit will be shared between them. If no amount is provided, it will be one by default
Examples:
?limit:$Coven:4
- Caps spawning of coven faction roles at 4
?limit:%Mayor
- Caps spawning of Mayor at 1, the default. Essentially makes it unique
- individuality:filters
Makes it so that all filtered roles will only spawn a maximum of 1. If no filters are supplied, all roles become unique
Examples:
?individuality:Town Power
- Makes all roles with Town Power tag unique
?individuality:$Mafia!%Consort
- Makes all roles part of Mafia faction unique, except Consort
- exclusive:filters:filters2
Makes all filtered roles mutually exclusive to each other, meaning if one generates, the rest of them cant.
If two arguments are specified, the filtered roles will be mutually exclusive with the other filtered roles instead
Examples:
?exclusive:%Warlock|%Soul Collector
- Makes Warlock and Soul Collector mutually exclusive
?exclusive:Town Power|Town Killing
- Makes all roles with either Town Power tag or Town Killing tag mutually exclusive to each other
?exclusive:!$Town:%Atheist
- Makes Atheist mutually exclusive with all non Town roles
You can change the weight of roles to make them more or less likely to spawn
For example, multiplying the weight of Sheriff by 10 will give it 10 times the chance to spawn in all slots it can generate in
Specifying a limit will disable the weight after the limit has been reached, by default weights have no limit.
The default weight for all roles is 10
Format: =filter:weight:limit
Examples:
=%Sheriff:x10
- Multiply weight of sheriff by 10 (100)
=$Town:/2
- Divide weight of all town roles by 2 (5)
=Cursed:-9
- Subtracts the weight of all roles with Cursed tag by 9 (1)
=Town Power:+40
- Adds the weight of all roles with Town Power tag by 40 (50)
=%Cleric:1000
- Sets weight of cleric spawning to 1000
=%Oracle:x20:1
- Multiply weight of Oracle spawning by 20, but when 1 Oracle generates, the weight will be normal again for future slots
If the filter matches no roles, or if the weight of a role <= 0, generation will fail.