GithubHelp home page GithubHelp logo

alexmi-ha / discordbotmanagerapi Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 146 KB

Management API for all of your Discord Bots

License: MIT License

Dockerfile 1.04% Python 39.18% Shell 0.75% HTML 8.22% CSS 18.67% JavaScript 32.14%
botsfordiscord discord python

discordbotmanagerapi's Introduction

Discord Bot Management API

API to manage all of your Discord Bots
Starting app-api.py starts a web server listening on port 9989

Endpoints

Make sure to set the x-api-key header to your API Key specified in the .env file!

GET /api/discordbots
Retrieves all running bots in following format:

{
  "Id": 0,
  "Name": "string",
  "Description": "string",
  "IsRunning": false
}

POST /api/discordbots/{id}
Starts the Discord bot with the given ID

DELETE /api/discordbots/{id}
Stops the Discord bot with the given ID

DELETE /api/discordbots
Stops all Discord bots that are currently running

UI Variant

There is also a UI example supplied in app-ui.py it uses an OAuth security token to authenticate the user and serves a simple UI for the interaction with the API.

The jwt token is read from the identity-token cookie.

Setup (only for no-ui variant)

Create a .env file in the root folder of the project. There you can specify all your secrets.

API_TOKEN=SuperSecretApiKeyToAccessThisManagementApi_AddItToEveryHeader
BOT1_TOKEN=DiscordBotToken
...

Add all your Bot-Scripts to the /discord/bots/ folder and edit the /discord/bots/bots.txt like:

<ID>:<NAME>:<DESCRIPTION>:<PATH>
1:Test Bot:Dieser Bot steht zu Testzwecken zur verfügung:./discord/bots/test/testbot.py
2:Test2:Description2:Path2
...

You can access the Discord Bot Tokens from the .env file via os.getenv('BOT1_TOKEN')

Build

  • Without Docker
    pip3 install -r requirements.txt
    python3 app-api.py

  • With Docker
    Run the build.sh

discordbotmanagerapi's People

Contributors

alexmi-ha avatar

Watchers

 avatar  avatar

Forkers

r1ccoon

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.