Git Product home page Git Product logo

delegator's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.