Skip to content

Calbabreaker/kontrolbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kontrol Bot

A cross platform application that allows you to control your computer through discord using shell commands.

Setup

Getting the bot

First go to the applications control panel, create an application, then make a bot, then create a .env file with BOT_TOKEN=put bot token here as its contents. Then go to http://discord.com/oauth2/authorize?client_id=APP_ID&scope=bot with APP_ID being the application ID to add it to a server.

Running it

First make sure you have nodejs and yarn installed. Then get the source code of this repository (by doing git clone https://github.com/Calbabreaker/kontrolbot/ or downloading as a zip) and then run yarn at the root directory of the repository.

Now you can run it directly on your computer by running yarn start.

You can also run it inside of a docker container by doing yarn start:docker -t calbabreaker/kontrolbot. You can also build a docker image with yarn build:docker and run the image with the same run command but with calbabreaker/kontrolbot replaced with the built image tag.

Usage

To send a command, send a message with > at the front and it will execute it while sending back the output. You can use !kb kill to kill the current command although it might not respond if it's stuck in a loop.

By default everyone can use kontrolbot but if you want to restrict usage, add OWNERS= on seperate line in the .env file and add your username#tag or anyone's username#tag as a comma seperated list to the right of the =.

Example .env:

BOT_TOKEN=000000000000000.0000.00000000000000000
OWNERS=User#1013,AmazingUser#2184

Now only the specified OWNERS can use kontrol bot. OWNERS can also allow other people to use kontrol bot by sending !kb allow username#tag but that person they cannot allow others. You can disallow them by doing !kb disallow username#tag. You can also allow or disallow everyone by having the username#tag be *.