Giter Site home page Giter Site logo

pluralkit's Introduction

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 and a PostgreSQL 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.Bot.Prefixes: an array of command prefixes to use (default ["pk;", "pk!"]).
  • PluralKit.Bot.ClientId (optional): the ID of the bot's user account, used when generating invite links through pk;invite. It's automatically determined if not present, but overriding it may be useful for private instances that still want a public invite link.
  • 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/xSke/PluralKit
  • Create a pluralkit.conf file in the same directory as docker-compose.yml containing at least a PluralKit.Bot.Token field
    • (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/xSke/PluralKit
$ cd PluralKit
$ cp pluralkit.conf.example pluralkit.conf
$ nano pluralkit.conf  # (or vim, or whatever)
$ docker-compose up -d

Manually

  • Install the .NET 5 SDK (see https://dotnet.microsoft.com/download)
  • Clone this repository: git clone https://github.com/xSke/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.)

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.

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

pluralkit's People

Contributors

bakakiller avatar beefox-sys avatar dependabot[bot] avatar greysdawn avatar nephanim avatar ryonez avatar thes1lv3r avatar xbelladonna avatar xske avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.