Skip to content

k5342/delegator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

delegator

A simple discord bot to delegate everything using discord slash commands based on your pre-defined profiles.

Use cases

  • 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

Install

(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)

  1. Clone this repository: git clone https://github.com/k5342/delegator
  2. Build this project: make
  3. (You can find a binary named "delegator" if the build was succeed)
  4. Setup config file: ./delegator init
  5. (You can find a configuration file named "config.yaml"; please edit the file: $EDITOR config.yaml)
  6. Launch the bot: ./delegator run

Configuration

Delegator reads a configuration file formatted in YAML.

Example

Configuration

# 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

Screenshots

success timeout

About

A simple discord bot to delegate everything using discord slash commands based on your pre-defined profiles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published