List Discord bans
/api/discord/bansThe Discord server's bans as the bot last saw them. Bans that stand by default; status=lifted shows bans that were lifted, status=all both. search matches the name, username and id, case-insensitively. Newest first.
The whole list is read from Discord when the bot signs in and once a day, which needs Ban Members or View Audit Log (coverage.canRead); bans and unbans seen as they happen change the list between reads. bannedAt is null for a ban that was already in place when it was found, because Discord's list carries no date. coverage.listedAt is null until the whole list has been read once.
Needs the ViewAuditLog permission.
An API key, made on Settings, API keys. Every key starts with mbk_.
In: header
Query Parameters
int32int32Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
curl -X GET "https://example.com/api/discord/bans"{ "bans": [ { "userId": "string", "username": null, "displayName": null, "avatarUrl": null, "reason": null, "bannedAt": null, "firstSeenAt": "2019-08-24T14:15:22Z", "liftedAt": null } ], "total": 0, "page": 0, "pageSize": 0, "coverage": { "guildId": null, "listedAt": null, "canRead": true, "standing": 0, "now": "2019-08-24T14:15:22Z" }}Get Discord server GET
The Discord server in settings as its own server profile shows it: name, icon and banner, the day it was made (read from its id), Discord's member count from the newest reading, how many members Discord counts as online, and its boosts and boost level. All but the online count is what the bot last stored. The online count is asked of Discord and kept five minutes, and is null when the bot is not connected. Every field is null when no server is set. Needs the `ViewMembers` permission.
Ban on Discord POST
Ban one person from the Discord server. `userId` is their Discord id; `reason` goes to Discord's audit log with your account's name; `deleteMessageDays` (0 to 7, default 0) has Discord delete that many days of their messages too. One request, never retried. Once Discord accepts, the audit log records who asked. `changed` is false when they were already banned. Never the bot's own account, the server's owner or a Discord account linked to a Modbot staff account: those answer 403 `refused`. Needs the `DiscordBan` permission.