karma

command module
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 16 Imported by: 0

README

Karma

Karma is a webhook server for adding "karma points" to a set of discord servers. When registered with your Discord server, it will add the following commands:

gib - Awards one point to another user in the server accompanied by a message

checkkarma - Checks a given users current total of karma

topten - Checks the most awarded users' karma totals

Set up

After creating a Disord app and awarding the proper permissions (stuff relating to responding to messages), point the Interactions Endpoint Url to your server.

Here's are the env vars your server will need set:

Name Value
PORT What port the server should listen on
TLS_CERT_FILE Cert for TLS. If you're going to put the server behind an HTTPS connection then you can omit this and it will server just HTTP. But discord does require that the endpoint be over HTTPS
TLS_KEY_FILE The private key file component of serving over TLS. Optional if you're not doing that
DB_PATH Path to the sqlite DB file
DISCORD_TOKEN The token given by discord and used in the authorization of calls to discord
DISCORD_APP_ID The app id when you register the application
DISCORD_GUILD_IDS A comma-separated list of guild ids that the server should server for
DISCORD_VERIFY_KEY Discord gives you a public key that you have to use to verify their signed calls. They will send invalid requests to make sure you're verifying calls to your server
SKIP_REGISTER Optional. At startup, the server will call to register commands with the given guild ID's. This can be rate limited, so if you want to skip that, just set this to true

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
core/models
Package models provides the structs exposed by the core package, but put in an independent package to break the dependency cycle between `core` and `db`
Package models provides the structs exposed by the core package, but put in an independent package to break the dependency cycle between `core` and `db`
discserv
Package discserv provides a way to run an http server with logging and other necessary things
Package discserv provides a way to run an http server with logging and other necessary things

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL