PawTalk Support
Sign in

Gateway

Last updated 4 October 2026

The gateway tells your bot what happens in its servers. It's a simple long-poll: ask, wait up to 25 seconds, get everything new.

How it works

  1. Say helloGET /gateway returns your current cursor.
  2. Wait for eventsGET /gateway?cursor=N&wait=25 answers as soon as something happens, or after 25 seconds with nothing.
  3. Move the cursorSave the new cursor from each answer and ask again. Missed events wait for you for 24 hours.
HelloResponse
GET /gateway
{ "op": "hello", "cursor": 1042, "wait_max": 25 }
DispatchResponse
GET /gateway?cursor=1042&wait=25
{ "op": "dispatch", "cursor": 1043,
  "events": [ { "id": 1043, "type": "MESSAGE_CREATE", "data": { ... } } ] }

The loop

Node.js 18+bot.js
const API = 'https://paw-talk.xyz/api/v1';
const H = { Authorization: 'Bearer ' + process.env.TOKEN };
let { cursor } = await (await fetch(API + '/gateway', { headers: H })).json();

while (true) {
  const r = await (await fetch(API + `/gateway?cursor=${cursor}&wait=25`, { headers: H })).json();
  for (const ev of r.events) handle(ev);   // your code
  cursor = r.cursor;                           // save it - restart from here
}
TipSave the cursor to disk. When your bot restarts, it picks up exactly where it stopped.

Events

EventWhenNeeds
MESSAGE_CREATEA message is postedmessage content for the text
MESSAGE_UPDATEA message is editedmessage content
MESSAGE_DELETEA message is deleted
REACTION_ADD / REACTION_REMOVESomeone reacts
MEMBER_JOIN / MEMBER_LEAVESomeone joins or leavesserver members
MEMBER_UPDATERoles or nickname changeserver members
VOICE_STATESomeone joins or leaves voice
INTERACTION_CREATEA command or button is used
POLL_UPDATEA vote is cast
GIVEAWAY_ENDA giveaway is drawn

Every event with its fields: GET /events/catalog

Intents

Some data is private by default. Turn these on for your bot in the Developer Portal:

Message contentThe text of messages. Without it, message events arrive without content.
Server membersJoin, leave and member update events.
Bots only hear what they can seeEvents only come from channels the bot has permission to view. If a server pauses its bots, events stop until it resumes them.

Didn't answer your question?

Somebody on the team will help.

Submit a request