No description https://pluralkit.me/
Find a file
2025-01-14 11:56:02 +09:00
.cargo feat: gateway service 2024-10-20 09:36:20 +09:00
.github fix(ci): update rust github actions workflow 2025-01-02 06:49:49 +00:00
ci fix(ci): specify new rust crates path 2025-01-02 05:20:43 +00:00
crates style: format 2025-01-14 11:56:02 +09:00
dashboard fix(dashboard): order shards correctly 2024-12-24 04:51:26 +00:00
docs docs: add plaintext to docs 2025-01-01 15:35:31 -07:00
Myriad fix(bot): ratelimit only initial websocket connection 2025-01-02 18:50:02 +00:00
PluralKit.API feat(api): accept member for latch autoproxy 2025-01-02 06:02:57 +00:00
PluralKit.Bot refactor(commands): remove args from parse command as it is no longer used anymore 2025-01-12 05:55:25 +09:00
PluralKit.Core fix: remove accidentally committed code 2025-01-02 05:20:43 +00:00
PluralKit.Tests refactor: remove protobuf 2024-12-24 02:43:41 +00:00
scripts feat(bot): add support for Discord message context commands (#513) 2023-05-16 03:17:34 +12:00
.dockerignore fix(ci): specify new rust crates path 2025-01-02 05:20:43 +00:00
.editorconfig chore: add golang to editorconfig 2023-05-26 11:31:48 +12:00
.gitignore chore: update cargo lock, ignore generated commands file 2025-01-03 20:26:52 +09:00
.gitmodules Replace Discord.Net with DSharpPlus 2020-04-17 18:38:12 +02:00
BRANCHRENAME.md master branch was deleted, update docs accordingly 2020-07-28 19:43:52 +02:00
Cargo.lock feat: implement proper ("static") parameters handling command parser -> bot 2025-01-05 13:00:06 +09:00
Cargo.toml fix: enable chrono on sqlx, libpk uses it 2025-01-04 00:39:21 +09:00
docker-compose.yml fix(docker-compose): add redis env var to api service (#528) 2023-03-07 08:12:23 +13:00
Dockerfile refactor: remove protobuf 2024-12-24 02:43:41 +00:00
flake.lock build: fix bot build, add generate commands binding app 2025-01-04 00:18:10 +09:00
flake.nix feat(commands): implement Display traits for Token and Command to have some basic 'doc gen', split Toggle into Enable and Disable 2025-01-08 18:31:59 +09:00
LEGACYMIGRATE.md Move legacy migration docs to a separate file and reword 2020-07-28 19:41:17 +02:00
netlify.toml Fix build directory reference in netlify.toml 2020-07-28 18:24:07 +02:00
pluralkit.conf.example feat: add redis requirements to readme (#542) 2023-03-24 15:05:25 +00:00
PluralKit.sln fix: build issues 2022-06-26 17:30:12 -04:00
README.md feat(docs): misc improvements 2023-03-25 15:26:55 -04:00
rust-toolchain.toml build: add rust-src componenet for rust-analyzer and such 2025-01-04 00:38:27 +09:00
shell.nix build(nix): add nix flake 2024-12-24 02:43:41 +00:00

PluralKit

PluralKit is a Discord bot meant for plural communities. It has features like message proxying through webhooks, switch tracking, system and member profiles, and more.

Do you just want to add PluralKit to your server? If so, you don't need any of this. Use the bot's invite link: https://discord.com/oauth2/authorize?client_id=466378653216014359&scope=bot%20applications.commands&permissions=536995904

PluralKit has a Discord server for support, feedback, and discussion: https://discord.gg/PczBt78

Requirements

Running the bot requires .NET 5, a PostgreSQL database and a Redis database. It should function on any system where the prerequisites are set up (including Windows).

Optionally, it can integrate with Sentry for error reporting and InfluxDB for aggregate statistics.

Configuration

Configuring the bot is done through a JSON configuration file. An example of the configuration format can be seen in pluralkit.conf.example. The configuration file needs to be placed in the bot's working directory (usually the repository root) and must be called pluralkit.conf.

The configuration file is in JSON format (albeit with a .conf extension). The following keys are available (using . to indicate a nested object level), bolded key names are required:

  • PluralKit.Bot.Token: the Discord bot token to connect with
  • PluralKit.Database: the URI of the database to connect to (in ADO.NET Npgsql format)
  • PluralKit.RedisAddr: the host:port of a Redis database to connect to
  • PluralKit.Bot.Prefixes: an array of command prefixes to use (default ["pk;", "pk!"]).
  • PluralKit.Bot.ClientId: the ID of the bot's user account, used for calculating the bot's own permissions and for the link in pk;invite.
  • PluralKit.SentryUrl (optional): the Sentry client key/DSN to report runtime errors to. If absent, disables Sentry integration.
  • PluralKit.InfluxUrl (optional): the URL to an InfluxDB server to report aggregate statistics to. An example of these stats can be seen on the public stats page.
  • PluralKit.InfluxDb (optional): the name of an InfluxDB database to report statistics to. If either this field or PluralKit.InfluxUrl are absent, InfluxDB reporting will be disabled.
  • PluralKit.LogDir (optional): the directory to save information and error logs to. If left blank, will default to logs/ in the current working directory.

The bot can also take configuration from environment variables, which will override the values read from the file. Here, use : (colon) or __ (double underscore) as a level separator (eg. export PluralKit__Bot__Token=foobar123) as per ASP.NET config.

Running

Docker

The easiest way to get the bot running is with Docker. The repository contains a docker-compose.yml file ready to use.

  • Clone this repository: git clone https://github.com/PluralKit/PluralKit
  • Create a pluralkit.conf file in the same directory as docker-compose.yml containing at least PluralKit.Bot.Token and PluralKit.Bot.ClientId fields
    • (PluralKit.Database is overridden in docker-compose.yml to point to the Postgres container)
  • Build the bot: docker-compose build
  • Run the bot: docker-compose up

In other words:

$ git clone https://github.com/PluralKit/PluralKit
$ cd PluralKit
$ cp pluralkit.conf.example pluralkit.conf
$ nano pluralkit.conf  # (or vim, or whatever)
$ docker-compose up -d

Manually

  • Install the .NET 6 SDK (see https://dotnet.microsoft.com/download)
  • Clone this repository: git clone https://github.com/PluralKit/PluralKit
  • Create and fill in a pluralkit.conf file in the same directory as docker-compose.yml
  • Run the bot: dotnet run --project PluralKit.Bot
    • Alternatively, dotnet build -c Release -o build/, then dotnet build/PluralKit.Bot.dll

(tip: use scripts/run-test-db.sh to run a temporary PostgreSQL database on your local system. Requires Docker.)

Scheduled Tasks worker

There is a scheduled tasks worker that needs to be ran separately from the bot. This handles cleaning up the database, and updating statistics (system/member/etc counts, shown in the pk;stats embed).

Note: This worker is not required, and the bot will function correctly without it.

If you are running the bot via docker-compose, this is set up automatically.

If you run the bot manually you can run the worker as such:

  • dotnet run --project PluralKit.ScheduledTasks
  • or if you used dotnet build rather than dotnet run to run the bot: dotnet build/PluralKit.ScheduledTasks.dll

Upgrading database from legacy version

If you have an instance of the Python version of the bot (from the legacy branch), you may need to take extra database migration steps. For more information, see LEGACYMIGRATE.md.

User documentation

See the docs/ directory

License

This project is under the GNU Affero General Public License, Version 3. It is available at the following link: https://www.gnu.org/licenses/agpl-3.0.en.html