mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fixed
This commit is contained in:
1 parent
0714d30a6f
commit
e4ae6a98bc
2 files changed
+23
-2
No files matched your search
@@ -508,6 +508,13 @@ export class PlayerManager {
|
|||||||
);
|
);
|
||||||
if (player) {
|
if (player) {
|
||||||
player.textChannel = message.channel;
|
player.textChannel = message.channel;
|
||||||
|
try {
|
||||||
|
const guildId = getMessageGuildId(message);
|
||||||
|
const textChannelId = message?.channel?.id ?? message?.channel?.channel?.id ?? null;
|
||||||
|
if (guildId && textChannelId) {
|
||||||
|
this.settings.getServer(guildId)?.set("announcementChannelId", textChannelId);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
// Also check if a join is in-progress for this channel
|
// Also check if a join is in-progress for this channel
|
||||||
@@ -542,6 +549,12 @@ export class PlayerManager {
|
|||||||
);
|
);
|
||||||
if (match) {
|
if (match) {
|
||||||
match[1].textChannel = message.channel;
|
match[1].textChannel = message.channel;
|
||||||
|
try {
|
||||||
|
const textChannelId = message?.channel?.id ?? message?.channel?.channel?.id ?? null;
|
||||||
|
if (cleanGuildId && textChannelId) {
|
||||||
|
this.settings.getServer(cleanGuildId)?.set("announcementChannelId", textChannelId);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
return match[1];
|
return match[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-2
@@ -351,7 +351,10 @@ export class RecoveryManager {
|
|||||||
const cachedChId = remix._announcementChannelCache.get(guildId)
|
const cachedChId = remix._announcementChannelCache.get(guildId)
|
||||||
?? serverSet.get("announcementChannelId")
|
?? serverSet.get("announcementChannelId")
|
||||||
?? null;
|
?? null;
|
||||||
let ch = cachedChId ? guild?.channels?.get(String(cachedChId)) : null;
|
let ch = p.textChannel?.channel ?? p.textChannel ?? null;
|
||||||
|
if (typeof ch?.send !== "function") {
|
||||||
|
ch = cachedChId ? guild?.channels?.get(String(cachedChId)) : null;
|
||||||
|
}
|
||||||
if (cachedChId && !ch) {
|
if (cachedChId && !ch) {
|
||||||
remix._announcementChannelCache.delete(guildId);
|
remix._announcementChannelCache.delete(guildId);
|
||||||
}
|
}
|
||||||
@@ -367,7 +370,12 @@ export class RecoveryManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof ch?.send === "function") ch.send({ embeds: [{ description: String(m), color: getGlobalColor() }] }).catch(() => {});
|
if (typeof ch?.send === "function") {
|
||||||
|
const payload = (typeof m === "object" && Array.isArray(m?.embeds))
|
||||||
|
? m
|
||||||
|
: { embeds: [{ description: String(m), color: getGlobalColor() }] };
|
||||||
|
ch.send(payload).catch(() => {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// ── Join channel ───────────────────────────────────────────────────────
|
// ── Join channel ───────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in new issue
Block a user