/api

Primary LanguageJavaScript

Rubix API

Documentation of the API.


Current version: 1

Prefix requests with /v1

All requests require a Authorisation header.


GET /guilds/@me

NOT IMPLEMENTED

Get a list of guilds the user is currently in and has permission to manage. Cached for 1 minute.

Returns

[
  {
    "name": "",
    "id": "",
    "roles": [{ "name": "", "id": "", "color": "", "permissions": "" }],
    "icon": ""
  }
]

GET /guilds/:id

Get a guild information. Cached for 1 minute.

Returns:

{
  "name": "",
  "id": "",
  "channels": [{ "name": "", "id": "", "type": 0 }],
  "roles": [{ "name": "", "id": "", "color": "", "permissions": "" }],
  "icon": ""
}

Errors:

Guild ID was not found (bot not there).

{ "error": "Guild not found" }

GET /guilds/:id/settings

Get a guilds settings. All fields are nullable.

Returns:

{
  "modlog_channel": "",
  "greeting": {
    "enabled": true,
    "message": "",
    "channelID": ""
  },
  "farewell": {
    "enabled": true,
    "message": "",
    "channelID": ""
  }
}

Errors:

User doesn't have permission to view settings.

{ "error": "Unauthorised" }

POST /guilds/:id/settings

Sets a guilds settings. No body fields are required.

Body:

{
  "modlog_channel": "",
  "greeting": {
    "enabled": true,
    "message": "",
    "channelID": ""
  },
  "farewell": {
    "enabled": true,
    "message": "",
    "channelID": ""
  }
}

Returns:

{
  "success": true
}

Errors:

User doesn't have permission to set settings.

{ "error": "Unauthorised" }

GET /guilds/:id/custom-commands

NOT IMPLEMENTED

Returns:

[
  {
    "name": "",
    "creator": "",
    "message": ""
  }
]

POST /guilds:id/custom-commands

NOT IMPLEMENTED

Create a new custom command.

Body:

{
  message: String,
  name: String
}

Returns:

{ "success": true }

Errors:

Command name is the same as a core command.

{ "error": "Core command already exists" }

Command name is the same as a pre-existing custom command.

{ "error": "Custom command already exists" }