moymo,Docs
Skip to content
Bots

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/gateway

How it works ​

It speaks the same small set of messages that other chat platforms' gateways do, so existing client libraries are easy to port:

OpcodeDirection
HELLOserver → youSent first; says how often to send heartbeats.
IDENTIFYyou → serverYour bot token and the intents you want.
READYserver → youYou are in; says which servers the bot is in and gives a session id.
HEARTBEATbothKeeps the connection alive.
DISPATCHserver → youAn event, with a sequence number.
RESUMEyou → serverAfter a dropped connection, continue from the last sequence number (kept for 2 minutes) without missing events.
RECONNECT, INVALID_SESSIONserver → youConnect 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.

IntentEvents
SERVERSThe bot was added or removed; channels, roles and emoji changed
MEMBERS (privileged)Members joined, left or changed
MESSAGESMessages were sent, edited, deleted
MESSAGE_CONTENT (privileged)The text of messages (without it you get who, when and the id, not what)
REACTIONSReactions were added or removed
VOICE_STATESWho is in which voice channel
PRESENCES (privileged)Who is online or playing
INTERACTIONSCommands, buttons, selects, modals
POLLS, GIVEAWAYS, EVENTSThe same for those rooms
TYPINGSomeone 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.

The wiki is for Moymo's members and developers. Something wrong or missing? Use "Suggest a change" on any page.