A more robust implementation of PluralKit that hooks into the PluralKit API
Join our support and development server
- Create a new bot using the Discord Developer Portal
- Turn off "Public Bot"
- Turn on "Presence Intent" and "Server Members Intent"
Create a .env
file in the project root to set your environment variables. Polyphony takes all of it's configuration in the form of environment variables.
Required
TOKEN
- Discord Bot TokenGUILD_ID
- Guild ID of server Polyphony is being used in
Role System
MODERATOR_ROLES
- List of role names (default: [Moderator, Moderators])INSTANCE_ADD_ROLE
- Comma-separated list (no spaces) of role names to automatically add to instance when started (default: [])INSTANCE_REMOVE_ROLE
- Comma-separated list (no spaces) of role names to automatically remove from instance when started (default: [])ALWAYS_SYNC_ROLES
- Comma-separated list (no spaces) of role names assigned to the main user that should always be synced to the member instance (default: [])NEVER_SYNC_ROLES
- Comma-separated list (no spaces) of role names assigned to member instances that should never be synced to the main userDISABLE_ROLESYNC_ROLES
- Comma-separated list (no spaces) of role names that disable rolesync (default: [])DEFAULT_INSTANCE_PERMS
- The permissions to suggest from the invite link generated by the invite command. (default: none, does not create a role)LOGGING_CHANNEL_ID
- Not Implemented Yet Channel to log Polyphony events (message edits, deletes, user updates, and errors) toCOMMAND_PREFIX
- The prefix to be used in Discord to activate Polyphony commands (default: ;;)ADMIN_LOGS_CHANNEL_ID
- (Future Feature) Where to put warnings and other logging messages. Make sure it is somewhere you can see. (default: none)
Delete Logs: If your server uses a delete logging bot, Polyphony will clean the extra delete log messages created by proxying.
DELETE_LOGS_CHANNEL_ID
- The channel ID where your server puts delete logs, the message ID needs to appear somewhere in the embed (default: 0)DELETE_LOGS_USER_ID
- The user ID that posts the delete logs (default: 0)
Advanced/Development
DEBUG
- Python Boolean, Activates Debug ModeDATABASE_URI
- Location of the SQLite database (See more info here) (default: (project root)/polyphony/polyphony.db)SYNC_BATCH_SIZE
- How many users to concurrently sync. Higher numbers can sometimes be slower. Some systems can handle more than others. (default: 5)
This project requires Python 3.9.1 and SQLite >=3.25.0
Dependency, testing, and build management is done using Poetry. Install Poetry on your system and then run poetry install
in the project root.
To run polyphony, use poetry run polyphony
.
How to add a member:
- Create a new bot using the Discord Developer Portal
- Turn off "Public Bot"
- On your server, run the command
;;tokens
. Make sure you have DMs turned on for your server. - Follow the instructions in your DMs
- Use
;;register
to register members (see;;help admin
for details)
NOTE: Never paste tokens on your server!
Help us build Polyphony!
- Fork your own branch
- Push your branch to GitHub
- Create a draft pull request or create an issue from a project card (yes, do this before writing any code)
Make sure to thoroughly describe your goals/changes/additions
Check projects to see if someone is already working on that feature
Check issues to make sure someone isn't already fixing that problem
- Write your code
- Commit and Push updates
- Mark your pull request as ready for review
- Code is formatted using Black.
- Readability > Efficiency
- Use camel case for class names and underscores for everything else
Ping a mod or open a ticket on The Valley discord server
- Describe what you expected to happen
- If possible, include reproducible examples
- Describe what actually happened (including logging messages and traceback)
- Double check your packages are the same as what is defined in the Pipfile
- Use Black to format your code
- Clearly list/explain what your patch adds/updates (include issue number if relevant)