mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fix(voice): fail-fast on missing connect perms and purge un-restorable player snapshots on boot
This commit is contained in:
1 parent
784458f387
commit
af23db1255
3 files changed
+30
-3
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user