Categorygithub.com/tyzbit/go-discord-amputator
repositorypackage
0.0.0-20240909140126-da3991e7b42a
Repository: https://github.com/tyzbit/go-discord-amputator.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

go-discord-amputator

Discord Amputator bot rewritten 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-amputator/local.db

VariableValue(s)
ADMINISTRATOR_IDSIDs of users allowed to use administrator commands
DB_DATABASEDatabase 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

Usage

Configure the bot with !amp config [setting] [value]. The settings are below:

SettingDefaultDescription
switchonEnable the bot: on, disable the bot: off
replytooffReply to the original message for context, on or off
embedonWhether to use an embed message or just reply with links (Discord will then auto preview them), on or off
guessonWhether to guess if the URL is difficult to amputate, on or off
maxdepth3The maximum number of links deep to go to find the canonical URL, any number

You can also use !amp stats to get amputation stats for your server.

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.