Skip to content

A Discord Bot to interact with and control Crafty Controller

License

Notifications You must be signed in to change notification settings

Coosanta17/crafty_discord_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crafty Controller Discord Bot.

A Discord Bot to interact with and control Crafty Controller through commands in chat

So far all it does is start one server.

How to use

A basic knowledge of command line is assumed.

  1. Install Nodejs and import the repository, then run the command in the repository folder:

    npm install
  2. Run the bot using command

    node .

Configuration File

Here is the default configuration file:

{
    "bot": {
        "token": "BOT_TOKEN"
    },
    "crafty": {
        "api_token": "CRAFTY_TOKEN",
        "server_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "url": "https://localhost:8000/"
    },
    "commands": {
        "slash": {
            "enabled": true
        },
        "text": {
            "enabled": false,
            "prefix": "!"
        }
    }
}

bot.token - The discord bot's token. Learn how to get one here

crafty:

api_token - The api token for crafty controller user, make sure it has the COMMANDS permission and access to the server.

server_id - The uuid of the server. You can find it in the link to the server near the end.

url - The url to access the controller

commmands:

slash.enabled - Whether slash commands are enabled, recommended true

text.enabled and text.prefix - Whether text commands are enabled, for example, if prefix if set to !, help command would be !help

Commands

/start - Starts the preconfigured server

Other stuff

I am still learning JavaScript so if you find any errors or bad practice any help is appreciated.

Future Features:

  • Turn server off after period of time.
  • Config file.
  • Turn server off with a command (configurable).
  • Handling multiple servers.
  • Channel binds for different servers.
  • Statistics (players and stuff) *maybe?*.
  • suggestions are welcome!

LICENSE.

Check License tab.