fix(core): reset textChannel reference on announcement permission errors

- Unset player.textChannel when encountering MISSING_PERMISSIONS (403)
- Prevents player from repeatedly attempting to announce in blocked channels
This commit is contained in:
NoLogicAlan committed 2026-10-27 00:18:13 +03:00
1 parent 5d29301b38
commit 53d0990ebe
2 files changed
+2

No files matched your search

+1
View File
@@ -567,6 +567,7 @@ const PlayerLifecycleMixin = {
ch = asSendable(ch);
ch.send(payload).catch(err => {
if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) {
player.textChannel = null;
logger.warn(`[PlayerManager] Cannot send player message in channel ${ch.id} — missing permissions`);
} else {
logger.warn(`[PlayerManager] Failed to send player message in channel ${ch.id}:`, err?.message ?? err);