Skip to content

DoggieLicc/discord-sdg-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDG Helper

A helper for social-deduction games hosted on Discord

Support Server - Join for help with the bot!

This bot runs on discord.py

Invite this bot:

Invite Link, it's recommended to not remove any permissions, as some or all commands may stop working

Self-hosting guide:

  1. Create a bot account in the Discord Dev portal and invite it to your server. - Guide

  2. Enable member and message intents - Example

  3. Install the latest version of python if you don't have it already. - Download

  4. Download the source code either by using the "Download ZIP" option or running

git clone https://github.com/DoggieLicc/discord-sdg-helper

  1. Open a terminal/command prompt in the discord-sdg-helper folder
  2. Create a virtual environment: python -m venv .venv
  3. Activate the virtual environment: .venv\Scripts\activate (command prompt) or source ./.venv/bin/activate (linux)
  4. Install requirements: pip install -r requirements.txt
  5. Create a file named .env
  6. Edit it and add BOT_TOKEN=<token> where <token> is the bot's token you got from step 1, then save
  7. Run the main script: python main.py or python3 main.py
  8. Sync the application commands by the text command sdg.sync in a channel the bot has access to

Enviroment Variables:

  • BOT_TOKEN - The bot token to run on (Required)
  • DO_FIRST_SYNC - If set to true, will run command sync on startup
  • DEVELOPMENT_GUILD - ID of guild to sync commands to
  • GUIDE_CHANNEL_ID - ID of forum to read guides from
  • PROMETHEUS_PORT - Port to serve Prometheus metrics on
  • DISABLE_PROMETHEUS - Set to true to disable Prometheus metrics
  • DATABASE_FILENAME - Name of database file. Defaults to guild_info.db

How to use this bot:

This bot uses the slash commands system provided by Discord. Type / to see the available commands

Rolelist Generation

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

Symbols:

Filters:

% - Role

$ - Faction (You can also use #forum)

(no symbol is for forum tags)

ANY - No filter, case-sensitive (dont combine with ! ...)

Logic:

& - Seperator

| - Union (Roles only have to be part of atleast one of the unioned filters)

! - Negation (Will negate the next filter's roles)

Global Filters:

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

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

Weights

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.

About

Helper for Social Deductions Games hosted on Discord

Resources

License

Stars

Watchers

Forks

Languages