Gateway
Endpoints
wss://gateway.foxogram.su
- Productionwss://gateway.dev.foxogram.su
- Development
Opcodes (op
)
0
- Dispatch1
- Identify2
- Hello3
- Heartbeat4
- Heartbeat ACK
Events (t
)
MESSAGE_CREATE
MESSAGE_UPDATE
MESSAGE_DELETE
CHANNEL_CREATE
CHANNEL_UPDATE
CHANNEL_DELETE
MEMBER_ADD
MEMBER_REMOVE
MEMBER_UPDATE
Error codes
4001
- Unauthorized4002
- Heartbeat Timeout
Message structure
Field | Description |
---|---|
op | Opcode |
d | Data |
s? | Sequence number |
t? | Event name |
s
and t
are null when op
is not 0
(Dispatch)
Send
{
"op": 2,
"d": {}
}
Receive
{
"op": 0,
"d": {},
"s": 42,
"t": "EVENT_NAME"
}
Examples
Send events
Identify
{
"op": 1,
"d": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhIjowfQ.mpOO0N5hjaKrSl8EK16aFxSb_pqOUXVCQLNEt3-JBWg"
}
}
Heartbeat
{
"op": 3
}
Receive events
Hello
{
"op": 2,
"d": {
"heartbeat_interval": 30000
}
}
heartbeat_interval
value in milliseconds
Heartbeat ACK
{
"op": 4
}
Dispatch events
Message create
{
"op": 0,
"d": {},
"s": 42,
"t": "MESSAGE_CREATE"
}
d
type of message object