Categorygithub.com/tyzbit/go-discord-modtools
modulepackage
0.0.0-20241214154245-d13cec4a835b
Repository: https://github.com/tyzbit/go-discord-modtools.git
Documentation: pkg.go.dev

# README

go-discord-modtools

Discord moderation bot written in Go

Configuration

Set some environment variables before launching, or add a .env file.

If database environment variables are provided, the bot will save stats to an external database. Otherwise, it will save stats to a local sqlite database at /var/go-discord-modtools/local.db

VariableValue(s)
DB_TYPEmysql, postgres or unset for sqlite
DB_NAMEDatabase name for database
DB_HOSTHostname for database
DB_PASSWORDPassword for database user
DB_USERUsername for database user
LOG_LEVELtrace, debug, info, warn, error
TOKENThe Discord token the bot should use

PostgreSQL requires SSL to be enabled for your database.

Usage

In the Discord app, right click (Desktop) or long press (mobile) a message or user to see the available options.

Commands

Configure the bot (Highly recommended to do so only people in a specific role can use the moderation commands):

/settings

Get reputation for a user:

/query

Add a custom command (simply posts your desired block of text, Markdown formatting enabled)

/addcommand

Remove a custom command

/deletecommand

Get this help message:

/help

Development

Create a .env file with your configuration, at the bare minimum you need a Discord token for TOKEN.

You can either docker compose up --build to run with a mysql database, or just go run main.go to run with a sqlite database.

Self-hosting

# Packages

No description provided by the author