Skip to content

A more robust implmemntation of PluralKit that hooks into the PluralKit API

License

Notifications You must be signed in to change notification settings

naneko/Polyphony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polyphony

A more robust implementation of PluralKit that hooks into the PluralKit API

Join our support and development server

How to Run

Step 1: Create a bot

  • Create a new bot using the Discord Developer Portal
  • Turn off "Public Bot"
  • Turn on "Presence Intent" and "Server Members Intent"

Step 2: Create a .env file or set enviroment variables

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 Token
  • GUILD_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 user
  • DISABLE_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) to
  • COMMAND_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 Mode
  • DATABASE_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)

Step 3: Install Dependancies

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.

Step 4: Run

To run polyphony, use poetry run polyphony.

Step 5: Use

How to add a member:

  1. Create a new bot using the Discord Developer Portal
  2. Turn off "Public Bot"
  3. On your server, run the command ;;tokens. Make sure you have DMs turned on for your server.
  4. Follow the instructions in your DMs
  5. Use ;;register to register members (see ;;help admin for details)

NOTE: Never paste tokens on your server!

Contributing

Help us build Polyphony!

How to Contribute Code

  1. Fork your own branch
  2. Push your branch to GitHub
  3. 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

  1. Write your code
  2. Commit and Push updates
  3. Mark your pull request as ready for review

Style Guide

  • Code is formatted using Black.
  • Readability > Efficiency
  • Use camel case for class names and underscores for everything else

Questions

Ping a mod or open a ticket on The Valley discord server

Reporting Issues

  • 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

Submitting Patches

  • Use Black to format your code
  • Clearly list/explain what your patch adds/updates (include issue number if relevant)

About

A more robust implmemntation of PluralKit that hooks into the PluralKit API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages