fix(voice): fail-fast on missing connect perms and purge un-restorable player snapshots on boot

This commit is contained in:
NoLogicAlan committed 2026-10-22 02:32:25 +03:00
1 parent 784458f387
commit af23db1255
3 files changed
+30 -3

No files matched your search

+10 -2
View File
@@ -41,14 +41,22 @@ const RejoinManager = {
return player;
} catch (err) {
const errMsg = err?.message ?? String(err);
const isTransientError = errMsg.includes("track publication timed out")
const isPermissionError = errMsg.includes("permission")
|| errMsg.includes("Permission")
|| errMsg.includes("Bot lacks")
|| errMsg.includes("403")
|| errMsg.includes("Unauthorized");
const isTransientError = !isPermissionError && (
errMsg.includes("track publication timed out")
|| errMsg.includes("Voice connection timeout")
|| errMsg.includes("LiveKit connection timeout")
|| errMsg.includes("lavalink player create failed")
|| errMsg.includes("Failed to create audio player")
|| errMsg.includes("internal error")
|| errMsg.includes("ETIMEDOUT")
|| errMsg.includes("ECONNRESET");
|| errMsg.includes("ECONNRESET")
);
if (isTransientError && attempt < maxRetries) {
const backoffMs = baseDelay * Math.pow(2, attempt - 1);