Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

API Version 2

7coil edited this page Feb 3, 2019 · 5 revisions

API

Token

Tokens are provided on a per-bot basis. View your bot's bot list token by finding your bot and clicking the Token button.

  • All requests use JSON.
  • Please send POST requests with Content-Type: application/json with valid JSON in the body.
  • When a token is required (When token needed is shown), please add your token to your HTTP Authorization header.
    • Authorization: dd8c7533eabfa62174a549f7b11678962ec00f8727537

V2 Methods

https://ls.terminal.ink/api/v2/

GET /bots

Obtain a JSON encoded array of objects for all bots

GET /bots/:id

Obtain JSON encoded information about a specific bot

{
  "authors": [
    "205427654042583040"
  ],
  "cachedImages": { // https://ls.terminal.ink/appdata/image.png
    "avatar": "/appdata/7c5c872eb93e695362ae5bcb0b166da198721d5c74e379e1529d776f73464377.png",
    "cover": null,
    "preview": []
  },
  "category": "other",
  "contents": { // Contents of bot pages, but localised
    "en-GB": {
      "description": "An all-in-one and easy-to-use bot for Discord",
      "name": "Homer",
      "page": "<!-- Markdown page in English -->"
    },
    "fr": {
      "description": "Un bot tout-en-un pour Discord",
      "name": "Homer",
      "page": "<!-- Markdown page in French -->"
    }
  },
  "created": 1542569433000,
  "edited": 1542590182486,
  "github": {
    "owner": "iDroid27",
    "repo": "homer"
  },
  "id": "305277118105911296",
  "images": {
    "avatar": "https://cdn.discordapp.com/avatars/305277118105911296/83edde7cf67d195b5828b731fb9ff9a4.png",
    "cover": null,
    "preview": []
  },
  "invite": "https://homer.idroid.me",
  "legacy": true,
  "nsfw": false,
  "oauth": null,
  "random": 1.4167843460262775,
  "support": null,
  "trigger": {
    "customisable": false,
    "mentionable": false,
    "prefix": [
      "h:"
    ]
  },
  "verified": true,
  "website": null
}

POST /bots/:id token needed

Update your bot! Just send a JSON representation of your bot, in the same schema as above.

This API does not support changing nested keys. Keys such as trigger, images, or contents can therefore cannot be edited via the API.

All keys within the bot object are optional. Some may not be written.

Server count example

{
  "bot": {
    "count": 156
  }
}

Change category

{
  "bot": {
    "category": "fun"
  }
}

Change many things

{
  "bot": {
    "nsfw": true,
    "oauth": "123456",
    "website": "https://discordbots.co.uk/",
    "count": 87932,
    "category": "fun"
  }
}
Clone this wiki locally