mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
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:
1 parent
5d29301b38
commit
53d0990ebe
2 files changed
+2
No files matched your search
@@ -383,6 +383,7 @@ const BotVoiceMixin = {
|
||||
: { embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(m)], allowedMentions: { parse: [] } };
|
||||
ch.send(payload).catch(err => {
|
||||
if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) {
|
||||
player.textChannel = null;
|
||||
logger.warn(`[_spawnPlayer] Cannot send announcement in channel ${ch.id} — missing permissions`);
|
||||
} else {
|
||||
logger.warn(`[_spawnPlayer] Failed to send announcement in channel ${ch.id}:`, err?.message ?? err);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user