diff --git a/commands/join.mjs b/commands/join.mjs index 81b582e..40f0f16 100644 --- a/commands/join.mjs +++ b/commands/join.mjs @@ -59,19 +59,23 @@ export async function joinChannel(message, cid, cb = () => {}, ecb = () => {}) { const guildId = getGuildId(message); const is247 = (() => { - const raw = this.settingsMgr?.getServer?.(guildId)?.get?.("stay_247"); - return raw && raw !== "none"; + try { + const raw = this.settingsMgr?.getServer?.(guildId)?.get?.("stay_247"); + return raw && raw !== "none"; + } catch (_) { return false; } })(); const mode247 = (() => { if (!is247) return "off"; - const set = this.settingsMgr?.getServer?.(guildId); - const modes = set?.get?.("stay_247_modes"); - const matchCh = homeChannelId || activeChannelId; - if (modes && typeof modes === "object" && !Array.isArray(modes) && modes[matchCh]) { - return modes[matchCh]; - } - return set?.get?.("stay_247_mode") ?? "off"; + try { + const set = this.settingsMgr?.getServer?.(guildId); + const modes = set?.get?.("stay_247_modes"); + const matchCh = homeChannelId || activeChannelId; + if (modes && typeof modes === "object" && !Array.isArray(modes) && modes[matchCh]) { + return modes[matchCh]; + } + return set?.get?.("stay_247_mode") ?? "off"; + } catch (_) { return "off"; } })(); this.players.playerMap.delete(activeChannelId); diff --git a/commands/lastfm.mjs b/commands/lastfm.mjs index a6030c2..b17d8ed 100644 --- a/commands/lastfm.mjs +++ b/commands/lastfm.mjs @@ -139,7 +139,7 @@ function extractPeriod(data, msg) { /** * Resolve a Last.fm category (loved/top/recent/playlist) into playable tracks. - * Shared between `$prefixlastfm play ` and `$prefixplay lastfm:`. + * Shared between `%lastfm play ` and `%play lastfm:`. * * @param {object} ctx - The command `this` context (has .lastfm, .getPlayer, .handler, .t) * @param {object} msg - The message object diff --git a/commands/settings.mjs b/commands/settings.mjs index 021144d..97e3e9d 100644 --- a/commands/settings.mjs +++ b/commands/settings.mjs @@ -253,7 +253,7 @@ function build247StatusPanel(set, ctx, message, t, guildId) { } /** - * Build a simple embed for the $prefix247 on/auto confirmation. + * Build a simple embed for the %247 on/auto confirmation. * @param {object} set - ServerSettings * @param {string} channelId - Clean channel ID * @param {string} mode - "on" | "auto" @@ -298,7 +298,7 @@ function build247EnabledPanel(set, channelId, mode, joined, ctx, guildId, t) { } /** - * Build a simple embed for the $prefix247 off confirmation. + * Build a simple embed for the %247 off confirmation. * @param {object} set - ServerSettings * @param {string} channelId - Clean channel ID * @param {string} guildId - Guild ID @@ -630,7 +630,7 @@ export const command = function() { .addExamples( "$prefixsettings get", "$prefixsettings get prefix", - "$prefixsettings set prefix !", + "$prefixsettings set prefix %", "$prefixsettings set locale de-DE", "$prefixsettings set songAnnouncements off", "$prefixsettings set stay_247 auto", diff --git a/commands/trackopt.mjs b/commands/trackopt.mjs index b8cc073..a8eaa43 100644 --- a/commands/trackopt.mjs +++ b/commands/trackopt.mjs @@ -1,6 +1,7 @@ import { CommandBuilder } from "../src/CommandHandler.mjs"; import { EmbedBuilder } from "@fluxerjs/core"; import { getGlobalColor } from "../src/MessageHandler.mjs"; +import { logger } from "../src/constants/Logger.mjs"; const DEFAULT_ALIAS = "default"; diff --git a/src/GatewayHandler.mjs b/src/GatewayHandler.mjs index 31fc37c..aaef217 100644 --- a/src/GatewayHandler.mjs +++ b/src/GatewayHandler.mjs @@ -1111,7 +1111,7 @@ export class GatewayHandler { /** * Rejoin a voice channel after an unexpected disconnect. - * Used by the $prefix247 auto mode to automatically reconnect. + * Used by the %247 auto mode to automatically reconnect. * * Includes deduplication (prevents concurrent rejoin for the same channel) * and retry with exponential backoff for transient failures like track @@ -1332,9 +1332,9 @@ export class GatewayHandler { /** * Rejoin all 24/7 channels after boot with staggered delays. * - * Both $prefix247 auto and $prefix247 on channels are rejoined because: - * $prefix247 auto: always stays in voice (disconnect + reboot) - * $prefix247 on: only on reboot, not on disconnect + * Both %247 auto and %247 on channels are rejoined because: + * %247 auto: always stays in voice (disconnect + reboot) + * %247 on: only on reboot, not on disconnect * * Channels are rejoined one at a time with a delay between each to * avoid overwhelming the LiveKit server with concurrent track publications. diff --git a/src/LastFmManager.mjs b/src/LastFmManager.mjs index 5e24f71..df75b5d 100644 --- a/src/LastFmManager.mjs +++ b/src/LastFmManager.mjs @@ -5,7 +5,7 @@ * - Auth flow (desktop API: get token → user authorizes → get session) * - Now-playing notification (track.scrobble with timestamp=0) * - Full scrobble after threshold (50% of track or 4 min, whichever is less) - * - Fetch loved / top / recent tracks for $prefixplay lastfm loved/top/recent + * - Fetch loved / top / recent tracks for %play lastfm loved/top/recent * - Per-user session key storage in MySQL table `lastfm_users` * * Last.fm API docs: https: @@ -496,7 +496,7 @@ export class LastFmManager { } /** - * Get track info (play count, tags, etc.) for the $prefixnp embed. + * Get track info (play count, tags, etc.) for the %np embed. */ async getTrackInfo(artist, track, userId = null) { if (!this.enabled) return null; @@ -571,7 +571,7 @@ export class LastFmManager { /** * Search Last.fm for a freeform track query and return the best match. - * Useful for `$prefixplay lastfm: kendrick lamar luther` where artist/title + * Useful for `%play lastfm: kendrick lamar luther` where artist/title * boundaries are ambiguous. * * @param {string} query @@ -1476,7 +1476,7 @@ export class LastFmManager { } /** - * Get the user's top albums (for $prefixlastfm play albums). + * Get the user's top albums (for %lastfm play albums). * @param {string} userId * @param {string} [period="overall"] - overall | 7day | 1month | 3month | 6month | 12month * @param {number} [limit=20] diff --git a/src/Player.mjs b/src/Player.mjs index 4782026..f528a52 100644 --- a/src/Player.mjs +++ b/src/Player.mjs @@ -415,9 +415,9 @@ export default class Player extends EventEmitter { * Get the 24/7 mode for this player's channel. * Returns "auto", "on", or "off". * - * $prefix247 auto: bot stays in voice always (never leaves, auto-rejoins on disconnect + reboot) - * $prefix247 on: bot stays in voice always (never leaves due to inactivity, rejoins on reboot) - * $prefix247 off: bot leaves when inactive + * %247 auto: bot stays in voice always (never leaves, auto-rejoins on disconnect + reboot) + * %247 on: bot stays in voice always (never leaves due to inactivity, rejoins on reboot) + * %247 off: bot leaves when inactive */ _get247Mode() { if (!this._guildId) return "off";