From 6b05db5a2f9ea540e34e8429c07b96411d418b73 Mon Sep 17 00:00:00 2001 From: Snazzah Date: Fri, 27 Jun 2025 05:56:39 -0400 Subject: [PATCH] feat(voice): add close codes 4021 and 4022 (#1283) --- deno/voice/v4.ts | 8 ++++++++ deno/voice/v8.ts | 8 ++++++++ voice/v4.ts | 8 ++++++++ voice/v8.ts | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/deno/voice/v4.ts b/deno/voice/v4.ts index f06ec0fe..7a010ce1 100644 --- a/deno/voice/v4.ts +++ b/deno/voice/v4.ts @@ -160,4 +160,12 @@ export enum VoiceCloseCodes { * You sent a malformed request */ BadRequest = 4_020, + /** + * Disconnect due to rate limit exceeded. Should not reconnect + */ + RateLimited, + /** + * Disconnect all clients due to call terminated (channel deleted, voice server changed, etc.). Should not reconnect + */ + CallTerminated, } diff --git a/deno/voice/v8.ts b/deno/voice/v8.ts index f73b8d35..7b46772b 100644 --- a/deno/voice/v8.ts +++ b/deno/voice/v8.ts @@ -156,6 +156,14 @@ export enum VoiceCloseCodes { * You sent a malformed request */ BadRequest = 4_020, + /** + * Disconnect due to rate limit exceeded. Should not reconnect + */ + RateLimited, + /** + * Disconnect all clients due to call terminated (channel deleted, voice server changed, etc.). Should not reconnect + */ + CallTerminated, } /** diff --git a/voice/v4.ts b/voice/v4.ts index f06ec0fe..7a010ce1 100644 --- a/voice/v4.ts +++ b/voice/v4.ts @@ -160,4 +160,12 @@ export enum VoiceCloseCodes { * You sent a malformed request */ BadRequest = 4_020, + /** + * Disconnect due to rate limit exceeded. Should not reconnect + */ + RateLimited, + /** + * Disconnect all clients due to call terminated (channel deleted, voice server changed, etc.). Should not reconnect + */ + CallTerminated, } diff --git a/voice/v8.ts b/voice/v8.ts index f73b8d35..7b46772b 100644 --- a/voice/v8.ts +++ b/voice/v8.ts @@ -156,6 +156,14 @@ export enum VoiceCloseCodes { * You sent a malformed request */ BadRequest = 4_020, + /** + * Disconnect due to rate limit exceeded. Should not reconnect + */ + RateLimited, + /** + * Disconnect all clients due to call terminated (channel deleted, voice server changed, etc.). Should not reconnect + */ + CallTerminated, } /**