What a bot is
A bot is a member of a server that your code controls. In every list, message and permission check it is a member like any other: it has a username, a name, a picture and an id, it holds roles, and what it may do in a server is decided by the permissions of those roles and by each channel's overwrites, exactly as for a person.
It differs from a person in four ways:
- It carries a BOT tag wherever its name is drawn.
- It cannot sign in to Moymo. Nobody can: it has no password anyone can match, and its e-mail address is on a domain that does not deliver. You control it with its token.
- It is not on any public list: not in member search, not on a profile page, not on a leaderboard.
- It belongs to an application, and ends with it.
Making one
On the application's Bot tab, choose Add a bot. An application has at most one bot. You can give a username, or leave it to be made from the application's name (Dice Roller becomes dice_roller; if that is taken, a number is added).
| Field | Rules |
|---|---|
| Username | 3 to 24 lowercase letters, digits and underscores. It is shared with every member: it must be free, and names Moymo keeps for itself (admin, moymo, support...) are refused. It is how the bot is mentioned. |
| Name | What is shown. It follows the application's name unless you change it here. Subject to the same impersonation rules as the application's name. |
| About | Up to 190 characters. |
| Picture | JPG, PNG or WebP up to 5 MB. |
The token
The token is the bot's password: Authorization: Bot <token>. It is shown once. Reset token makes a new one and kills the old one at the same moment. See Tokens and secrets.
Where it can go
A bot is in a server because someone with Manage Server added it with the install link: see Adding a bot to a server. A server's owner can also kick it, as they can anyone; a server's roles page shows its managed role, which only the install can change.
While the application is a draft, only you and your testers can add the bot, to at most 25 servers. When it is published, anyone can add it if you made the bot public on the Installation tab; otherwise only you and your testers can.
What it can do
Everything a person with the same role could do, over the App API:
- read servers, channels, roles and members, and the messages it is allowed to read (intents guard what other people said);
- write messages with text, embeds and buttons and menus, reply, react, pin, edit and delete its own;
- answer commands: slash commands, commands on members and messages, buttons, menus and forms, over a signed HTTPS endpoint (interactions);
- manage: channels, roles, nicknames, timeouts, kicks and bans, with the same ladder as people;
- be added to and removed from servers, with a role of exactly the permissions it was given.
Next: a WebSocket gateway for events, webhooks, files on messages, and the rest of a server's features (see the roadmap).
Deleting a bot
Delete bot on the Bot tab removes the bot from every server, deletes the messages it sent and revokes its token. The application stays, and you can add a new bot (a new member with a new id) later.
Encrypted channels
Moymo for Windows can seal the text of a channel so that Moymo's server cannot read it. A bot is a server-side participant and cannot decrypt sealed text. A server that turns sealing on says so, and a bot in it will receive the events (who, when, the message id) with the content missing. Sealing of channel messages is switched off at the moment, so this is a note for the future, written down now so nothing about bots has to change then.