curl --request PUT \
--url https://discordbotlist.lol/api/v1/bots/{id}/commands \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"commands": [
{
"name": "ban",
"description": "Ban a member"
},
{
"name": "warn",
"description": "Warn a member and log it"
}
]
}
'import requests
url = "https://discordbotlist.lol/api/v1/bots/{id}/commands"
payload = { "commands": [
{
"name": "ban",
"description": "Ban a member"
},
{
"name": "warn",
"description": "Warn a member and log it"
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
commands: [
{name: 'ban', description: 'Ban a member'},
{name: 'warn', description: 'Warn a member and log it'}
]
})
};
fetch('https://discordbotlist.lol/api/v1/bots/{id}/commands', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://discordbotlist.lol/api/v1/bots/{id}/commands",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'commands' => [
[
'name' => 'ban',
'description' => 'Ban a member'
],
[
'name' => 'warn',
'description' => 'Warn a member and log it'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://discordbotlist.lol/api/v1/bots/{id}/commands"
payload := strings.NewReader("{\n \"commands\": [\n {\n \"name\": \"ban\",\n \"description\": \"Ban a member\"\n },\n {\n \"name\": \"warn\",\n \"description\": \"Warn a member and log it\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://discordbotlist.lol/api/v1/bots/{id}/commands")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"commands\": [\n {\n \"name\": \"ban\",\n \"description\": \"Ban a member\"\n },\n {\n \"name\": \"warn\",\n \"description\": \"Warn a member and log it\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://discordbotlist.lol/api/v1/bots/{id}/commands")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commands\": [\n {\n \"name\": \"ban\",\n \"description\": \"Ban a member\"\n },\n {\n \"name\": \"warn\",\n \"description\": \"Warn a member and log it\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"count": 2
}{
"error": "Invalid JSON body."
}{
"error": "Invalid token."
}{
"error": "Bot not found."
}{
"error": "Rate limit exceeded.",
"retryAfter": 42
}Publish the commands
Replace the commands shown on the bot’s page. PUT rather than POST on purpose: a bot that removed a command has to be able to say so, and a merge would leave the removed one on the page with nothing able to delete it.
The shape mirrors Discord’s own application command objects, so a bot can forward what it already registered. Duplicate names are dropped, keeping the first. An empty array clears the list. Rate limit: 10 requests per minute per token — enough to clear a restart loop, not a stream.
curl --request PUT \
--url https://discordbotlist.lol/api/v1/bots/{id}/commands \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"commands": [
{
"name": "ban",
"description": "Ban a member"
},
{
"name": "warn",
"description": "Warn a member and log it"
}
]
}
'import requests
url = "https://discordbotlist.lol/api/v1/bots/{id}/commands"
payload = { "commands": [
{
"name": "ban",
"description": "Ban a member"
},
{
"name": "warn",
"description": "Warn a member and log it"
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
commands: [
{name: 'ban', description: 'Ban a member'},
{name: 'warn', description: 'Warn a member and log it'}
]
})
};
fetch('https://discordbotlist.lol/api/v1/bots/{id}/commands', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://discordbotlist.lol/api/v1/bots/{id}/commands",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'commands' => [
[
'name' => 'ban',
'description' => 'Ban a member'
],
[
'name' => 'warn',
'description' => 'Warn a member and log it'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://discordbotlist.lol/api/v1/bots/{id}/commands"
payload := strings.NewReader("{\n \"commands\": [\n {\n \"name\": \"ban\",\n \"description\": \"Ban a member\"\n },\n {\n \"name\": \"warn\",\n \"description\": \"Warn a member and log it\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://discordbotlist.lol/api/v1/bots/{id}/commands")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"commands\": [\n {\n \"name\": \"ban\",\n \"description\": \"Ban a member\"\n },\n {\n \"name\": \"warn\",\n \"description\": \"Warn a member and log it\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://discordbotlist.lol/api/v1/bots/{id}/commands")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commands\": [\n {\n \"name\": \"ban\",\n \"description\": \"Ban a member\"\n },\n {\n \"name\": \"warn\",\n \"description\": \"Warn a member and log it\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"count": 2
}{
"error": "Invalid JSON body."
}{
"error": "Invalid token."
}{
"error": "Bot not found."
}{
"error": "Rate limit exceeded.",
"retryAfter": 42
}Authorizations
The bot's API token, generated on its edit page. Sent bare or as Bearer <token> -- both are accepted, because the libraries already posting to other lists send both. The token is shown once; generating a new one invalidates the old.
Path Parameters
The bot's Discord application id. It has to be the bot the token belongs to.
^\d{17,19}$Body
100Show child attributes
Show child attributes