UnderAnder / discord_roll

Almost useless Discord bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Almost useless Discord bot

Text commands

  • !roll <max> <times> (!ролл)
  • !duel [@user] [bet] (!дуэль)
  • !bet [bet] (!ставка)
  • !city [city] (!город) the database needs to be populated
  • !score (!очки)
  • !top (!лидеры, !leaderboard)
  • !help (!помощь)

Slash commands

it is necessary to register commands with the --reg-commands flag

use the --del-commands flag to remove slash commands after the bot is turned off

  • /roll
  • /duel
  • /bet
  • /city the database needs to be populated
  • /score
  • /top

Installation

Build the bot binary using the make target build:

make build

Run the db migrations (golang-migrate is needed for this):

make migrate-up

Once it is built and the migrations applied, then the bot can be run at minimum with the -t and the -db flags:

./bin/bot -t <TOKEN> -db <PATH_TO_DB>

To acquire the bot token, follow the Discord API Docs.

Configuration

configs/config.yml

bot:
  lang: en # should be "en" or "ru"
  guild-id: # if specified the bot will only work on this guild (server)
  city-channel: # if specified the cities game will work only on this channel
repository:
  sqlite:
    location: # db location

Docker

A Docker image containing the bot and migration utility can be built using

make docker-image

To run the image, pass the token in via the BOT_TOKEN environment variable:

docker run -e BOT_TOKEN=<TOKEN> bot

To make the store persistent, just mount /bot/data to an external volume:

docker run -e BOT_TOKEN=<TOKEN> -v data:/bot/data bot

About

Almost useless Discord bot

License:MIT License


Languages

Language:Go 94.8%Language:Makefile 3.9%Language:Dockerfile 1.3%