The gateway
Planned: not available yet
This page describes what is being built. None of it exists yet; see the roadmap.
The gateway is a WebSocket that delivers events to your bot as they happen: a message was sent, a member joined, a button was pressed. It is how a bot stays aware without asking over and over.
The address (planned)Text
text
wss://moymo.net/api/app/v1/gatewayHow it works
It speaks the same small set of messages that other chat platforms' gateways do, so existing client libraries are easy to port:
| Opcode | Direction | |
|---|---|---|
HELLO | server → you | Sent first; says how often to send heartbeats. |
IDENTIFY | you → server | Your bot token and the intents you want. |
READY | server → you | You are in; says which servers the bot is in and gives a session id. |
HEARTBEAT | both | Keeps the connection alive. |
DISPATCH | server → you | An event, with a sequence number. |
RESUME | you → server | After a dropped connection, continue from the last sequence number (kept for 2 minutes) without missing events. |
RECONNECT, INVALID_SESSION | server → you | Connect again, or start a fresh session. |
JSON frames, with optional compression.
Intents
An intent is a group of events you ask for. You get only what you ask for, which keeps a small bot small.
| Intent | Events |
|---|---|
SERVERS | The bot was added or removed; channels, roles and emoji changed |
MEMBERS (privileged) | Members joined, left or changed |
MESSAGES | Messages were sent, edited, deleted |
MESSAGE_CONTENT (privileged) | The text of messages (without it you get who, when and the id, not what) |
REACTIONS | Reactions were added or removed |
VOICE_STATES | Who is in which voice channel |
PRESENCES (privileged) | Who is online or playing |
INTERACTIONS | Commands, buttons, selects, modals |
POLLS, GIVEAWAYS, EVENTS | The same for those rooms |
TYPING | Someone is typing |
Privileged intents see more of what people write and do. A draft application can use them in up to 25 servers; beyond that they need approval.
A bot sees exactly what a member in its place would: events are filtered by the bot's permissions in each channel.
Encrypted channels
A channel whose text is sealed end to end cannot be read by a bot. Its events arrive with the author, time and id, and encrypted: true, with no content. See Bots.