Permissions
Your bot is a normal member of every server it's in. It gets the server's default permissions plus whatever its roles give it, and channel overrides apply to it too. Server admins decide what it can do, so only ask for what you need.
Permission values
permissions on a server or channel is a number: the sum of the permissions your bot has there.
| Permission | Value | Lets your bot |
|---|---|---|
VIEW_CHANNELS | 1 | See a channel and read its messages |
SEND_MESSAGES | 2 | Send messages and react |
MANAGE_MESSAGES | 4 | Delete other people's messages, pin, skip slow mode and AutoMod |
MANAGE_CHANNELS | 8 | Create, edit, reorder and delete channels, skip slow mode |
MANAGE_ROLES | 32 | Give and take roles below its own |
KICK_MEMBERS | 128 | Kick members below it |
ADMINISTRATOR | 256 | Do everything |
BAN_MEMBERS | 8192 | Ban and unban members below it |
MODERATE_MEMBERS | 16384 | Time out members below it |
The other values (16, 64, 512 to 4096, 32768) are for things bots can't do yet.
To check one:
const can = (permissions, value) => (permissions & value) === value;
if (can(channel.permissions, 2)) await orbit.send(channel.id, 'hi');def can(permissions, value):
return permissions & value == valuefunc can(permissions, value uint64) bool { return permissions&value == value }Role order
A bot can only kick, ban or time out members whose highest role is below its own highest role, and never the server owner. It can only give or take roles below its own highest role. If your moderation commands fail with 403, move the bot's role up.
Timeouts
A timed-out bot can only read until the timeout ends. The server's timed_out_until tells you when.
Orbit's rules
Some things aren't allowed anywhere on Orbit, for people and bots alike: swearing, sexual talk and political talk. Messages, cards, command answers, command descriptions and your bot's name are all checked. Text that breaks a rule fails with 403 and the code swearing, sexual_content or political, whatever the server's own settings. Nothing about the refused text is kept.
AutoMod
Servers can block words, links and invites. Your bot's messages, cards and command answers are checked like everyone else's, unless it has MANAGE_MESSAGES. A blocked message fails with 403 and the code blocked.
Some servers make new members wait a few minutes before they can talk. That counts for bots too: until then sending fails with 429, the code too_new and a Retry-After header.