A simple discord bot to delegate everything using discord slash commands based on your pre-defined profiles.
- You can delegete to the bot to restart a game server process
- You can delegate to the bot to backup your home server
- You can delegate to the bot to run a pre-defined shell script
(required) go 1.19, tested on Ubuntu 22.04 on WSL2
(required) you need to issue a bot token at the Discord Developer Portal (https://discord.com/developers/applications)
- Clone this repository:
git clone https://github.com/k5342/delegator
- Build this project:
make
- (You can find a binary named "delegator" if the build was succeed)
- Setup config file:
./delegator init
- (You can find a configuration file named "config.yaml"; please edit the file:
$EDITOR config.yaml
) - Launch the bot:
./delegator run
Delegator reads a configuration file formatted in YAML.
# issue your discord bot token from Discord Developer Portal
discord_bot_token: ...
# you can list commands here
commands:
- name: date
exec: /usr/bin/date # a full path to the command
description: Returns a result of date command
- name: timeout
exec: /usr/bin/sleep 10
description: an example for execution time timeout
timeout:
seconds: 5 # default is infinity (= 0). this limits to 5s