discordbot
We drive the Discord API
with curl + jq using the user's bot token in $DISCORDBOT_TOKEN. The
auth header is Authorization: Bot $DISCORDBOT_TOKEN — note the literal
Bot prefix (NOT Bearer). Base URL is https://discord.com/api/v10.
This acts as the user's registered bot, so it can only see and act in
servers (guilds) the bot has been invited to and only where it has the
relevant permission (View Channels / Send Messages / Read Message History).
A 403 Forbidden (code 50001 "Missing Access" / 50013 "Missing
Permissions") almost always means the bot isn't in that server or lacks the
permission — tell the user to invite the bot or grant the permission rather
than retrying.
Errors are JSON {"code": <n>, "message": "<reason>"}. A 401 means the
bot token is wrong/reset — ask the user to re-paste it at
auth.acedata.cloud/user/connections. A 429 carries retry_after
(seconds) — sleep that long, then retry; never parallelize.