Coder Social home page Coder Social logo

xdfnleaks / managebot Goto Github PK

View Code? Open in Web Editor NEW
16.0 1.0 1.0 50 KB

just a little project i'm working on that allows you to view and manage your docker containers from discord.

License: GNU General Public License v3.0

Python 91.29% Dockerfile 8.71%
discord discord-bot discordbot discordpy disocrd-py docker docker-container linux management python

managebot's Introduction

managebot

Version 1.0.4 has been released!

just a little project i'm working on that allows you to view and manage your docker containers from discord.


What's New? (v1.0.4)

very small update today.

  • Uptime command

Features

  • Executing Docker Commands (/docker execute) (start, stop, restart, pause, unpause, delete)
  • Listing all docker containers and sorts them into Online & Offline. (/list)
  • Docker Image Management + Image Pruning (/docker images | /docker prune)

Planned Features

  • Web Interface (possibly, not 100% sure if I can make this right now)

Installation

Please create a config folder and inside a config.json file.

config.json Template

{
  "token": "INPUT DISCORD TOKEN HERE",
  "timezone_offset": 0, # Set this to your offset in your timezone. e.g. 11 (+11)
  "guild_ids": [ENTER GUILD ID HERE],
  "allowed_user_ids": [ENTER ADMIN ID HERE],
    "status": {
        "type": "playing",
        "message": "with docker-compose.yaml files"
    }
}

Open config.json and edit it to your liking.

  • token = Your discord bot token. (Discord Developer Portal)
  • timezone_offset = Your timezone offset. (List of UTC offsets - Wikipedia)
  • guild_ids = Your server ID. (Tutorial)
  • allowed_user_ids = The ID of the bot admin. (Tutorial)
  • type = The Rich Presence type (Playing ..., Watching ...) - Currently available: Playing, Watching, Listening.
  • message = The message that shows up after type (Playing {message}, Watching {message})

Inviting your bot

Once you have created your bot, got your token and filled out config.json, you will now have to invite your bot.

  1. Click OAuth2 --> URL Generator
  2. For scopes, select bot & applications.commands.
  3. For Bot Permissions, I recommend selecting administrator.
  4. Scroll down, copy the invite and invite your bot to your server.

Now is time to run the bot.

docker-compose.yaml

version: "3.3"
services:
  managebot:
    container_name: managebot
    privileged: true
    restart: unless-stopped
    image: "ghcr.io/xdfnleaks/managebot:latest"
    volumes:
      - /your/path/to/managebot/config:/usr/src/app/config
      - /var/run/docker.sock:/var/run/docker.sock

Edit /your/path/to/managebot to wherever you put managebot.

Once your discord bot comes online. You are free to begin using commands.

How to start, stop & restart the bot

The most simple way to start, stop or restart managebot is directly from the command line.

Start

sudo docker start managebot

Stop

sudo docker stop managebot

Restart

sudo docker restart managebot

Issues

Please report any issues you have with the bot in the Issues tab!

managebot's People

Contributors

miraisubject avatar xdfnleaks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

miraisubject

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.