fix: correct unknown command name reporting and silence background voice pings (#10)

This commit is contained in:
NoLogicAlan committed 2026-10-21 04:14:10 +03:00
1 parent f2bfff59b5
commit cf278ed68c
4 files changed
+13 -6

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ import { logger } from "../src/core/Logger.mjs";
export const command = new CommandBuilder() export const command = new CommandBuilder()
.setName("stats") .setName("stats")
.setDescription("Display stats about the bot like the uptime.", "commands.stats") .setDescription("Display stats about the bot like the uptime.", "commands.stats")
.addAliases("info") .addAliases("info", "botinfo", "about")
.setCategory("util"); .setCategory("util");
/** Cache is considered fresh for this long; older values trigger a background refresh. */ /** Cache is considered fresh for this long; older values trigger a background refresh. */
+1 -1
View File
@@ -159,7 +159,7 @@ export class CommandHandler extends EventEmitter {
} }
if (!this.commandNames.includes(args[0].toLowerCase())) { if (!this.commandNames.includes(args[0].toLowerCase())) {
this.replyHandler(this.t(guildId, "cmdHandler.command.invalid", { command: this.format("$prefix$helpCmd", guildId) }), msg); this.replyHandler(this.t(guildId, "cmdHandler.command.invalid", { command: `${prefix}${args[0]}` }), msg);
return; return;
} }
return this.processCommand(this.commands.find(e => e.aliases.includes(args[0].toLowerCase())), args, msg); return this.processCommand(this.commands.find(e => e.aliases.includes(args[0].toLowerCase())), args, msg);
+1 -1
View File
@@ -608,7 +608,7 @@ class Player extends EventEmitter {
} catch (e) { } catch (e) {
const causeStr = e.cause ? ` (Cause: ${e.cause})` : ""; const causeStr = e.cause ? ` (Cause: ${e.cause})` : "";
logger.warn("[Player] Join failed:", e.message, causeStr); logger.player("[Player] Join failed:", e.message, causeStr);
if (this._voiceConn) { if (this._voiceConn) {
try { await this._voiceConn.disconnect(); } catch(err) { logger.warn("[Player] voiceConn disconnect on join failure:", err?.message); } try { await this._voiceConn.disconnect(); } catch(err) { logger.warn("[Player] voiceConn disconnect on join failure:", err?.message); }
+10 -3
View File
@@ -56,9 +56,16 @@ const RejoinManager = {
continue; continue;
} }
logger.warn( const failCount = this.rejoinBackoff?.failures?.(channelId) ?? 0;
`[${context}] Failed to rejoin channel ${channelId}: ${errMsg} — keeping 24/7 setting intact.` if (failCount >= 2) {
); logger.voice247(
`[${context}] Background rejoin failed for channel ${channelId} (failure #${failCount + 1}): ${errMsg} — keeping 24/7 setting intact.`
);
} else {
logger.warn(
`[${context}] Failed to rejoin channel ${channelId}: ${errMsg} — keeping 24/7 setting intact.`
);
}
return null; return null;
} }
} }