harmony/src/types/gatewayTypes.ts

59 lines
1.4 KiB
TypeScript
Raw Normal View History

// https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway
/**
* Gateway OPcodes from Discord docs.
*/
enum GatewayOpcodes { // 문서를 확인해본 결과 Opcode 5번은 비어있다. - UnderC -
DISPATCH = 0,
HEARTBEAT = 1,
IDENTIFY = 2,
PRESENCE_UPDATE = 3,
VOICE_STATE_UPDATE = 4,
RESUME = 6,
RECONNECT = 7,
REQUEST_GUILD_MEMBERS = 8,
INVALID_SESSION = 9,
HELLO = 10,
HEARTBEAT_ACK = 11
}
/**
* Gateway Close Codes from Discord docs.
*/
enum GatewayCloseCodes {
UNKNOWN_ERROR = 4000,
UNKNOWN_OPCODE = 4001,
DECODE_ERROR = 4002,
NOT_AUTHENTICATED = 4003,
AUTHENTICATION_FAILED = 4004,
ALREADY_AUTHENTICATED = 4005,
INVALID_SEQ = 4007,
RATE_LIMITED = 4008,
SESSION_TIMED_OUT = 4009,
INVALID_SHARD = 4010,
SHARDING_REQUIRED = 4011,
INVALID_API_VERSION = 4012,
INVALID_INTENTS = 4013,
DISALLOWED_INTENTS = 4014
}
enum GatewayIntents {
GUILDS = 1 << 0,
GUILD_MEMBERS = 1 << 1,
GUILD_BANS = 1 << 2,
GUILD_EMOJIS = 1 << 3,
GUILD_INTEGRATIONS = 1 << 4,
GUILD_WEBHOOKS = 1 << 5,
GUILD_INVITES = 1 << 6,
GUILD_VOICE_STATES = 1 << 7,
GUILD_PRESENCES = 1 << 8,
GUILD_MESSAGES = 1 << 9,
GUILD_MESSAGE_REACTIONS = 1 << 10,
GUILD_MESSAGE_TYPING = 1 << 11,
DIRECT_MESSAGES = 1 << 12,
DIRECT_MESSAGE_REACTIONS = 1 << 13,
DIRECT_MESSAGE_TYPING = 1 << 13
}
export { GatewayCloseCodes, GatewayOpcodes, GatewayIntents }