2021-04-04 09:29:56 +00:00
|
|
|
import type { MemberPayload } from './guild.ts'
|
2020-12-02 12:29:52 +00:00
|
|
|
|
2020-12-15 05:38:37 +00:00
|
|
|
export enum VoiceOpcodes {
|
2020-12-02 12:29:52 +00:00
|
|
|
IDENTIFY = 0,
|
|
|
|
SELECT_PROTOCOL = 1,
|
|
|
|
READY = 2,
|
|
|
|
HEARTBEAT = 3,
|
|
|
|
SESSION_DESCRIPTION = 4,
|
|
|
|
SPEAKING = 6,
|
|
|
|
HEARTBEAT_ACK = 6,
|
|
|
|
RESUME = 7,
|
|
|
|
HELLO = 8,
|
|
|
|
RESUMED = 9,
|
|
|
|
CLIENT_DISCONNECT = 13
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum VoiceCloseCodes {
|
|
|
|
UNKNOWN_OPCODE = 4001,
|
|
|
|
NOT_AUTHENTICATED = 4003,
|
|
|
|
AUTHENTICATION_FAILED = 4004,
|
|
|
|
ALREADY_AUTHENTICATED = 4005,
|
|
|
|
SESSION_NO_LONGER_VALID = 4006,
|
|
|
|
SESSION_TIMEOUT = 4009,
|
|
|
|
SERVER_NOT_FOUNT = 4011,
|
|
|
|
UNKNOWN_PROTOCOL = 4012,
|
|
|
|
DISCONNECTED = 4014,
|
|
|
|
VOICE_SERVER_CRASHED = 4015,
|
|
|
|
UNKNOWN_ENCRYPTION_MODE = 4016
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface VoiceStatePayload {
|
|
|
|
guild_id?: string
|
|
|
|
channel_id: string | null
|
|
|
|
user_id: string
|
|
|
|
member?: MemberPayload
|
|
|
|
session_id: string
|
|
|
|
deaf: boolean
|
|
|
|
mute: boolean
|
|
|
|
self_deaf: boolean
|
|
|
|
self_mute: boolean
|
|
|
|
self_stream?: boolean
|
|
|
|
self_video: boolean
|
|
|
|
suppress: boolean
|
2021-04-04 11:27:02 +00:00
|
|
|
request_to_speak_timestamp: string | null
|
2020-12-02 12:29:52 +00:00
|
|
|
}
|
2021-01-21 12:39:51 +00:00
|
|
|
|
|
|
|
/** Voice Region Structure */
|
|
|
|
export interface VoiceRegion {
|
|
|
|
/** Unique ID for the region */
|
|
|
|
id: string
|
|
|
|
/** Name of the region */
|
|
|
|
name: string
|
|
|
|
/** True if this is a vip-only server */
|
|
|
|
vip: boolean
|
|
|
|
/** True for a single server that is closest to the current user's client */
|
|
|
|
optimal: boolean
|
|
|
|
/** Whether this is a deprecated voice region (avoid switching to these) */
|
|
|
|
deprecated: boolean
|
|
|
|
/** Whether this is a custom voice region (used for events/etc) */
|
|
|
|
custom: boolean
|
|
|
|
}
|