chore: bump @fluxerjs/core + voice to v1.4.0, add allowedMentions suppression

- Bump SDK deps to ^1.4.0 (ws security fix, official { ping: false }
  support, allowedMentions on channel.send)
- Add allowedMentions: { parse: [] } to announcement channel.send()
  calls in PlayerManager, index._spawnPlayer, and GatewayHandler
  permission warnings — prevents accidental pings from embed
  descriptions containing user mentions
- Fix unhandled rejection in CommandLoader error-reply: the fallback
  data.message.reply() wasn't caught, so a network failure during the
  error-reply itself would crash. Now wrapped in
  Promise.resolve(...).catch(...)
This commit is contained in:
NoLogicAlan committed 2026-06-20 22:49:56 +03:00
1 parent 20813bd1ff
commit 49447dc37b
5 files changed
+23 -12

No files matched your search

+4 -1
View File
@@ -784,7 +784,10 @@ export class Remix {
if (!player.textChannel) player.textChannel = ch; if (!player.textChannel) player.textChannel = ch;
ch.send(typeof m === "object" && Array.isArray(m.embeds) ? m : { embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(m)] }).catch(err => { const payload = typeof m === "object" && Array.isArray(m.embeds)
? { ...m, allowedMentions: { parse: [] } }
: { embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(m)], allowedMentions: { parse: [] } };
ch.send(payload).catch(err => {
if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) { if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) {
logger.warn(`[_spawnPlayer] Cannot send announcement in channel ${ch.id} — missing permissions`); logger.warn(`[_spawnPlayer] Cannot send announcement in channel ${ch.id} — missing permissions`);
} }
+2 -2
View File
@@ -4,8 +4,8 @@
"node": ">=22.0.0" "node": ">=22.0.0"
}, },
"dependencies": { "dependencies": {
"@fluxerjs/core": "^1.3.1", "@fluxerjs/core": "^1.4.0",
"@fluxerjs/voice": "^1.3.1", "@fluxerjs/voice": "^1.4.0",
"bcryptjs": "^3.0.3", "bcryptjs": "^3.0.3",
"ffmpeg-static": "^5.3.0", "ffmpeg-static": "^5.3.0",
"ffprobe-static": "^3.1.0", "ffprobe-static": "^3.1.0",
+6 -2
View File
@@ -822,19 +822,23 @@ export class CommandLoader {
this.commands.on("run", (data) => { this.commands.on("run", (data) => {
if (!this.runnables.has(data.command.uid)) return; if (!this.runnables.has(data.command.uid)) return;
const runFc = this.runnables.get(data.command.uid); const runFc = this.runnables.get(data.command.uid);
const sendErrorReply = (id) => {
Promise.resolve(data.message.reply("An error occurred. Error id: `#" + id + "`"))
.catch(err => logger.warn("[CommandHandler] Failed to send error-reply; error id #" + id + ":", err?.message));
};
try { try {
const result = runFc.call(this.context, data.message, data); const result = runFc.call(this.context, data.message, data);
if (result && typeof result.catch === "function") { if (result && typeof result.catch === "function") {
result.catch(e => { result.catch(e => {
const id = Utils.uid(); const id = Utils.uid();
logger.error("Error running command; error id #" + id, e); logger.error("Error running command; error id #" + id, e);
data.message.reply("An error occurred. Error id: `#" + id + "`"); sendErrorReply(id);
}); });
} }
} catch (e) { } catch (e) {
const id = Utils.uid(); const id = Utils.uid();
logger.error("Error running command; error id #" + id, e); logger.error("Error running command; error id #" + id, e);
data.message.reply("An error occurred. Error id: `#" + id + "`"); sendErrorReply(id);
} }
}); });
} }
+6 -5
View File
@@ -138,16 +138,17 @@ export class GatewayHandler {
try { try {
const permEmbed = remix.messages.buildPermissionEmbed(result.missing, guildId); const permEmbed = remix.messages.buildPermissionEmbed(result.missing, guildId);
await targetChannel.send({ embeds: [permEmbed] }); await targetChannel.send({ embeds: [permEmbed], allowedMentions: { parse: [] } });
} catch (e) { } catch (e) {
logger.warn(`[GuildCreate] Cannot send permission warning to server ${guildId}: ${e.message}`); logger.warn(`[GuildCreate] Cannot send permission warning to server ${guildId}: ${e.message}`);
try { try {
const t = this.remix.locale?.translate?.bind(this.remix.locale); const t = this.remix.locale?.translate?.bind(this.remix.locale);
const guildIdStr = cleanId(guildId); const guildIdStr = cleanId(guildId);
await targetChannel.send( await targetChannel.send({
t ? t(guildIdStr, "responses.gateway.missingPermsFallback", { perms: missingNames.join("**, **") }) : content: t ? t(guildIdStr, "responses.gateway.missingPermsFallback", { perms: missingNames.join("**, **") }) :
"⚠️ I'm missing permissions I need to work properly! Missing: **" + missingNames.join("**, **") + "**. Please ask a server administrator to grant these permissions in Server Settings → Roles." "⚠️ I'm missing permissions I need to work properly! Missing: **" + missingNames.join("**, **") + "**. Please ask a server administrator to grant these permissions in Server Settings → Roles.",
); allowedMentions: { parse: [] },
});
} catch (e) { } catch (e) {
logger.warn(`[GuildCreate] Cannot send ANY notification to server ${guildId} — bot is missing SendMessages permission:`, e?.message); logger.warn(`[GuildCreate] Cannot send ANY notification to server ${guildId} — bot is missing SendMessages permission:`, e?.message);
} }
+5 -2
View File
@@ -853,7 +853,7 @@ export class PlayerManager {
?? `Left channel <#${activeChannelId}> because of inactivity.\nIf you want me to stay in voice, use \`${prefix}247 on/auto\``; ?? `Left channel <#${activeChannelId}> because of inactivity.\nIf you want me to stay in voice, use \`${prefix}247 on/auto\``;
} }
if (typeof ch?.send === "function") { if (typeof ch?.send === "function") {
ch.send({ embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(desc)] }).catch(err => { ch.send({ embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(desc)], allowedMentions: { parse: [] } }).catch(err => {
if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) { if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) {
logger.warn(`[PlayerManager] Cannot send autoleave message in channel ${ch.id} — missing permissions`); logger.warn(`[PlayerManager] Cannot send autoleave message in channel ${ch.id} — missing permissions`);
} }
@@ -910,7 +910,10 @@ export class PlayerManager {
if (!player.textChannel) player.textChannel = ch; if (!player.textChannel) player.textChannel = ch;
ch.send(typeof m === "object" && Array.isArray(m.embeds) ? m : { embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(m)] }).catch(err => { const payload = typeof m === "object" && Array.isArray(m.embeds)
? { ...m, allowedMentions: { parse: [] } }
: { embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(m)], allowedMentions: { parse: [] } };
ch.send(payload).catch(err => {
if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) { if (err.code === 'MISSING_PERMISSIONS' || err.statusCode === 403) {
logger.warn(`[PlayerManager] Cannot send player message in channel ${ch.id} — missing permissions`); logger.warn(`[PlayerManager] Cannot send player message in channel ${ch.id} — missing permissions`);
} }