mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
refactor: centralize prefix resolution into CommandHandler
Replace all scattered prefix lookups across the codebase with a single source of truth: CommandHandler.getPrefix(guildId).
This commit is contained in:
1 parent
23d0dbc522
commit
ba479e4c04
25 files changed
+155
-159
No files matched your search
+11
-20
@@ -59,23 +59,19 @@ export async function joinChannel(message, cid, cb = () => {}, ecb = () => {}) {
|
||||
const guildId = getGuildId(message);
|
||||
|
||||
const is247 = (() => {
|
||||
try {
|
||||
const raw = this.settingsMgr?.getServer?.(guildId)?.get?.("stay_247");
|
||||
return raw && raw !== "none";
|
||||
} catch (_) { return false; }
|
||||
const raw = this.settingsMgr?.getServer?.(guildId)?.get?.("stay_247");
|
||||
return raw && raw !== "none";
|
||||
})();
|
||||
|
||||
const mode247 = (() => {
|
||||
if (!is247) return "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"; }
|
||||
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";
|
||||
})();
|
||||
|
||||
this.players.playerMap.delete(activeChannelId);
|
||||
@@ -85,9 +81,7 @@ export async function joinChannel(message, cid, cb = () => {}, ecb = () => {}) {
|
||||
|
||||
if (is247 && (mode247 === "on" || mode247 === "auto")) {
|
||||
const rejoinDelay = this.config?.timers?.rejoin247Delay ?? 3_000;
|
||||
const prefix = (() => {
|
||||
try { return this._commands?.getPrefix?.(guildId) ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = this._commands.getPrefix(guildId);
|
||||
const embed = new EmbedBuilder().setColor(getGlobalColor())
|
||||
.setDescription(this.t(message, "responses.join.autoLeaveInactive247", { channel: activeChannelId, prefix }));
|
||||
message.channel.send({ embeds: [embed] }).catch(() => {});
|
||||
@@ -101,9 +95,6 @@ export async function joinChannel(message, cid, cb = () => {}, ecb = () => {}) {
|
||||
}
|
||||
}, rejoinDelay);
|
||||
} else {
|
||||
const prefix = (() => {
|
||||
try { return this._commands?.getPrefix?.(guildId) ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const embed2 = new EmbedBuilder().setColor(getGlobalColor())
|
||||
.setDescription(this.t(message, "responses.join.autoLeaveInactive", { channel: activeChannelId }));
|
||||
message.channel.send({ embeds: [embed2] }).catch(() => {});
|
||||
@@ -190,7 +181,7 @@ export async function run(message, data) {
|
||||
const cid = this.players.checkVoiceChannels(message);
|
||||
|
||||
if (!cid) {
|
||||
const prefix = this._commands?.getPrefix?.(getGuildId(message)) ?? "%";
|
||||
const prefix = this._commands.getPrefix(getGuildId(message));
|
||||
const embed = new EmbedBuilder().setColor(getGlobalColor())
|
||||
.setDescription(this.t(message, "responses.join.noVoiceChannel", { prefix }));
|
||||
return message.reply({ embeds: [embed] });
|
||||
|
||||
+3
-3
@@ -139,7 +139,7 @@ function extractPeriod(data, msg) {
|
||||
|
||||
/**
|
||||
* Resolve a Last.fm category (loved/top/recent/playlist) into playable tracks.
|
||||
* Shared between `%lastfm play <cat>` and `%play lastfm:<cat>`.
|
||||
* Shared between `$prefixlastfm play <cat>` and `$prefixplay lastfm:<cat>`.
|
||||
*
|
||||
* @param {object} ctx - The command `this` context (has .lastfm, .getPlayer, .handler, .t)
|
||||
* @param {object} msg - The message object
|
||||
@@ -153,7 +153,7 @@ function extractPeriod(data, msg) {
|
||||
*/
|
||||
export async function playLastFmCategory(ctx, msg, userId, category, options = {}) {
|
||||
const lastfm = ctx.lastfm;
|
||||
const prefix = ctx.handler?.getPrefix?.(msg.message?.guildId) ?? "%";
|
||||
const prefix = ctx.handler.getPrefix(msg.message?.guildId);
|
||||
const resolveProvider = options.resolveProvider || "yt";
|
||||
|
||||
if (!lastfm || !lastfm.enabled) return msg.reply(notConfigured(ctx, msg));
|
||||
@@ -332,7 +332,7 @@ export async function run(msg, data) {
|
||||
const lastfm = this.lastfm;
|
||||
if (!lastfm || !lastfm.enabled) return msg.reply(notConfigured(this, msg));
|
||||
|
||||
const prefix = this.handler?.getPrefix?.(msg.message?.guildId) ?? "%";
|
||||
const prefix = this.handler.getPrefix(msg.message?.guildId);
|
||||
const action = data.get("action")?.value ?? "profile";
|
||||
const userId = msg.message?.author?.id ?? msg.author?.id;
|
||||
const targetUserId = data.get("user")?.value ?? null;
|
||||
|
||||
+3
-3
@@ -76,7 +76,7 @@ export async function run(msg, data) {
|
||||
return msg.reply(embed(
|
||||
this.t(msg, "responses.leave.specifyChannel", {
|
||||
channels: channelList.map(c => `• ${c}`).join("\n"),
|
||||
prefix: this.getSettings(msg)?.get("prefix") ?? "%"
|
||||
prefix: this._commands.getPrefix(msg.message?.guildId ?? msg.channel?.guild?.id)
|
||||
})
|
||||
));
|
||||
}
|
||||
@@ -135,7 +135,7 @@ export async function run(msg, data) {
|
||||
player.destroy();
|
||||
|
||||
if (mode === "auto") {
|
||||
msg.reply(embed(this.t(msg, "responses.leave.leftRejoin247", { channel: targetChannelId, prefix: set?.get("prefix") ?? "%" })));
|
||||
msg.reply(embed(this.t(msg, "responses.leave.leftRejoin247", { channel: targetChannelId, prefix: this._commands.getPrefix(msg.message?.guildId ?? msg.channel?.guild?.id) })));
|
||||
const leave247Delay = this.config?.timers?.leave247RejoinDelay ?? 5000;
|
||||
setTimeout(() => {
|
||||
if (this._spawnPlayer) {
|
||||
@@ -171,7 +171,7 @@ export async function run(msg, data) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
msg.reply(embed(this.t(msg, "responses.leave.left247On", { prefix: set?.get("prefix") ?? "%" })));
|
||||
msg.reply(embed(this.t(msg, "responses.leave.left247On", { prefix: this._commands.getPrefix(msg.message?.guildId ?? msg.channel?.guild?.id) })));
|
||||
|
||||
if (other247AutoChannels.length > 0) {
|
||||
const rejoinDelay = this.config?.timers?.leave247RejoinDelay ?? 5000;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ export async function run(message, data) {
|
||||
const totalTracks = p.queue.size();
|
||||
|
||||
if (!current && totalTracks === 0) {
|
||||
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(message, "responses.list.empty", { prefix: "%" }));
|
||||
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(message, "responses.list.empty", { prefix: this._commands.getPrefix(message.message?.guildId ?? message.channel?.guildId) }));
|
||||
return message.reply({ embeds: [embed] });
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ function parseInlineProvider(raw) {
|
||||
export const command = new CommandBuilder()
|
||||
.setName("playnext")
|
||||
.setId("playnext")
|
||||
.setDescription("Same as %play but adds the result to the top of the queue.", "commands.playnext")
|
||||
.setDescription("Same as $prefixplay but adds the result to the top of the queue.", "commands.playnext")
|
||||
.setCategory("music")
|
||||
.addExamples(
|
||||
"$prefixplaynext blinding lights",
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ async function playStation(ctx, msg, radio, editTarget = null) {
|
||||
if (current?.type === "radio" || hasRadioQueued) await p.switchRadio(radio);
|
||||
else p.playRadio(radio);
|
||||
|
||||
const prefix = (() => { try { return ctx.handler?.getPrefix?.(msg?.channel?.channel?.guildId ?? msg?.message?.guildId) ?? "%"; } catch (_) { return "%"; } })();
|
||||
const prefix = ctx.handler.getPrefix(msg?.channel?.channel?.guildId ?? msg?.message?.guildId);
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setTitle(`📻 ${radio.detailedName}`)
|
||||
|
||||
+24
-32
@@ -207,9 +207,7 @@ function resolveChannelName(client, channelId) {
|
||||
*/
|
||||
function build247StatusPanel(set, ctx, message, t, guildId) {
|
||||
const channels = [...get247Channels(set)];
|
||||
const prefix = (() => {
|
||||
try { return set.get("prefix") ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = ctx.handler.getPrefix(guildId);
|
||||
const locale = (key, data = {}) => t ? t(guildId, key, { ...data, prefix }) : key;
|
||||
|
||||
if (channels.length === 0) {
|
||||
@@ -255,7 +253,7 @@ function build247StatusPanel(set, ctx, message, t, guildId) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a simple embed for the %247 on/auto confirmation.
|
||||
* Build a simple embed for the $prefix247 on/auto confirmation.
|
||||
* @param {object} set - ServerSettings
|
||||
* @param {string} channelId - Clean channel ID
|
||||
* @param {string} mode - "on" | "auto"
|
||||
@@ -267,9 +265,7 @@ function build247StatusPanel(set, ctx, message, t, guildId) {
|
||||
function build247EnabledPanel(set, channelId, mode, joined, ctx, guildId, t) {
|
||||
const channels = [...get247Channels(set)];
|
||||
const modeStr = modeLabel(mode, t, guildId);
|
||||
const prefix = (() => {
|
||||
try { return set.get("prefix") ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = ctx.handler.getPrefix(guildId);
|
||||
const locale = (key, data = {}) => t ? t(guildId, key, { ...data, prefix }) : key;
|
||||
const chName = resolveChannelName(ctx.client, channelId);
|
||||
const label = chName ? `**${chName}** <#${channelId}>` : `<#${channelId}>`;
|
||||
@@ -302,17 +298,15 @@ function build247EnabledPanel(set, channelId, mode, joined, ctx, guildId, t) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a simple embed for the %247 off confirmation.
|
||||
* Build a simple embed for the $prefix247 off confirmation.
|
||||
* @param {object} set - ServerSettings
|
||||
* @param {string} channelId - Clean channel ID
|
||||
* @param {string} guildId - Guild ID
|
||||
* @param {Function} [t] - Locale translate function
|
||||
*/
|
||||
function build247DisabledPanel(set, channelId, guildId, t) {
|
||||
function build247DisabledPanel(set, channelId, guildId, t, ctx) {
|
||||
const channels = [...get247Channels(set)];
|
||||
const prefix = (() => {
|
||||
try { return set.get("prefix") ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = ctx.handler.getPrefix(guildId);
|
||||
const locale = (key, data = {}) => t ? t(guildId, key, { ...data, prefix }) : key;
|
||||
|
||||
if (channels.length === 0) {
|
||||
@@ -362,11 +356,9 @@ function format247Status(set, t, guildId) {
|
||||
return `${channels.size} channels: ${parts.join(", ")}`;
|
||||
}
|
||||
|
||||
function format247Summary(set, t, guildId) {
|
||||
function format247Summary(set, t, guildId, ctx) {
|
||||
const channels = [...get247Channels(set)];
|
||||
const prefix = (() => {
|
||||
try { return set.get("prefix") ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = ctx.handler.getPrefix(guildId);
|
||||
const locale = (key, data = {}) => t ? t(guildId, key, { ...data, prefix }) : key;
|
||||
|
||||
if (channels.length === 0) {
|
||||
@@ -421,7 +413,7 @@ async function handle247(ctx, message, value) {
|
||||
|
||||
if (!["off", "on", "auto"].includes(resolved)) {
|
||||
return message.reply(embed(
|
||||
ctx.t(message, "responses.settings.invalid247", { value, prefix: set.get("prefix") ?? "%" })
|
||||
ctx.t(message, "responses.settings.invalid247", { value, prefix: ctx.handler.getPrefix(guildId) })
|
||||
));
|
||||
}
|
||||
|
||||
@@ -450,7 +442,7 @@ async function handle247(ctx, message, value) {
|
||||
player.destroy();
|
||||
}
|
||||
const t247 = ctx.locale?.translate?.bind(ctx.locale);
|
||||
return message.reply(build247DisabledPanel(set, id, guildId, t247));
|
||||
return message.reply(build247DisabledPanel(set, id, guildId, t247, ctx));
|
||||
}
|
||||
|
||||
save247Channels(set, new Set());
|
||||
@@ -466,9 +458,7 @@ async function handle247(ctx, message, value) {
|
||||
player.destroy();
|
||||
}
|
||||
}
|
||||
const prefix = (() => {
|
||||
try { return set.get("prefix") ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = ctx.handler.getPrefix(guildId);
|
||||
const t247 = ctx.locale?.translate?.bind(ctx.locale);
|
||||
const loc = (key, data = {}) => t247 ? t247(guildId, key, { ...data, prefix }) : key;
|
||||
return message.reply(richEmbed([{
|
||||
@@ -487,7 +477,7 @@ async function handle247(ctx, message, value) {
|
||||
const userChannelId = ctx.players.checkVoiceChannels(message);
|
||||
if (!userChannelId) {
|
||||
return message.reply(embed(
|
||||
ctx.t(message, "responses.settings.noVoice247", { mode: resolved, prefix: set.get("prefix") ?? "%" })
|
||||
ctx.t(message, "responses.settings.noVoice247", { mode: resolved, prefix: ctx.handler.getPrefix(guildId) })
|
||||
));
|
||||
}
|
||||
|
||||
@@ -495,7 +485,7 @@ async function handle247(ctx, message, value) {
|
||||
const channels = get247Channels(set);
|
||||
if (!channels.has(id) && channels.size >= MAX_247_CHANNELS) {
|
||||
return message.reply(embed(
|
||||
ctx.t(message, "responses.settings.max247Channels", { max: MAX_247_CHANNELS, prefix: set.get("prefix") ?? "%" })
|
||||
ctx.t(message, "responses.settings.max247Channels", { max: MAX_247_CHANNELS, prefix: ctx.handler.getPrefix(guildId) })
|
||||
));
|
||||
}
|
||||
channels.add(id);
|
||||
@@ -518,9 +508,7 @@ async function handle247(ctx, message, value) {
|
||||
const t247 = ctx.locale?.translate?.bind(ctx.locale);
|
||||
return message.reply(build247EnabledPanel(set, id, resolved, true, ctx, guildId, t247));
|
||||
} catch (e) {
|
||||
const prefix = (() => {
|
||||
try { return set.get("prefix") ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = ctx.handler.getPrefix(guildId);
|
||||
const t247 = ctx.locale?.translate?.bind(ctx.locale);
|
||||
const loc = (key, data = {}) => t247 ? t247(guildId, key, { ...data, prefix }) : key;
|
||||
return message.reply(embed(
|
||||
@@ -620,7 +608,7 @@ export const command = function() {
|
||||
for (const [alias, settingKey] of Object.entries(SHORTCUTS)) {
|
||||
const builder = new CommandBuilder()
|
||||
.setName(alias)
|
||||
.setDescription(`Shortcut for \`${settingKey}\`. Usage: %${alias} [value]`)
|
||||
.setDescription(`Shortcut for \`${settingKey}\`. Usage: $prefix${alias} [value]`)
|
||||
.setId(`shortcut_${alias}`)
|
||||
.setCategory("util")
|
||||
.setRequirement(e => e.addPermission("ManageGuild"))
|
||||
@@ -710,19 +698,20 @@ export const command = function() {
|
||||
export async function run(message, data) {
|
||||
const set = this.getSettings(message);
|
||||
const cmd = data.commandId || "getSettings";
|
||||
const guildId = message.channel?.guildId ?? message.message?.guildId;
|
||||
|
||||
if (cmd?.startsWith("shortcut_")) {
|
||||
const alias = cmd.replace("shortcut_", "");
|
||||
const settingKey = SHORTCUTS[alias];
|
||||
const raw = (message.content ?? message.message?.content ?? "").trim();
|
||||
const prefix = set.get("prefix") ?? "%";
|
||||
const prefix = this.handler.getPrefix(guildId);
|
||||
const body = raw.startsWith(prefix) ? raw.slice(prefix.length).trim() : raw;
|
||||
const tokens = body.split(/\s+/).slice(1);
|
||||
return handleShortcut(this, message, settingKey, tokens);
|
||||
}
|
||||
|
||||
const raw = (message.content ?? message.message?.content ?? "").trim();
|
||||
const prefix = set.get("prefix") ?? "%";
|
||||
const prefix = this.handler.getPrefix(guildId);
|
||||
const body = raw.startsWith(prefix) ? raw.slice(prefix.length).trim() : raw;
|
||||
const args = body.split(/\s+/);
|
||||
const inlineShortcut = SHORTCUTS[args[1]?.toLowerCase()];
|
||||
@@ -759,8 +748,10 @@ export async function run(message, data) {
|
||||
}
|
||||
const val = set.get(settingKey);
|
||||
const description = this.settingsMgr.descriptions?.[settingKey];
|
||||
const prefix = ctx.handler.getPrefix(guildId);
|
||||
const resolvedDesc = description ? description.replace(/\$prefix/gi, prefix) : null;
|
||||
let reply = `**${prettifySettingLabel(settingKey)}**\nValue: ${displayValue(settingKey, val)}`;
|
||||
if (description) reply += `\n\n*${description}*`;
|
||||
if (resolvedDesc) reply += `\n\n*${resolvedDesc}*`;
|
||||
return message.reply(embed(reply));
|
||||
}
|
||||
|
||||
@@ -803,7 +794,7 @@ export async function run(message, data) {
|
||||
}
|
||||
|
||||
if (cmd === "helpSettings") {
|
||||
const pfx = set.get("prefix") ?? "%";
|
||||
const pfx = this.handler.getPrefix(guildId);
|
||||
|
||||
if (!settingKey) {
|
||||
const keys = Object.keys(this.settingsMgr.defaults);
|
||||
@@ -817,7 +808,8 @@ export async function run(message, data) {
|
||||
));
|
||||
}
|
||||
|
||||
const description = this.settingsMgr.descriptions?.[settingKey] ?? this.t(message, "responses.settings.noDescription");
|
||||
const rawDescription = this.settingsMgr.descriptions?.[settingKey] ?? this.t(message, "responses.settings.noDescription");
|
||||
const description = rawDescription.replace(/\$prefix/gi, pfx);
|
||||
const currentVal = set.get(settingKey);
|
||||
const defaultVal = this.settingsMgr.defaults?.[settingKey];
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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";
|
||||
|
||||
@@ -112,7 +111,7 @@ export async function run(msg, data) {
|
||||
return msg.reply({ embeds: [new EmbedBuilder().setColor("#ff0000").setDescription(this.t(msg, "responses._common.noVoiceChannel"))] });
|
||||
}
|
||||
|
||||
const prefix = this.handler?.getPrefix?.(msg.message?.guildId) ?? "%";
|
||||
const prefix = this.handler.getPrefix(msg.message?.guildId);
|
||||
|
||||
if (subCommand === "set") {
|
||||
const timesRaw = data.get("times")?.value;
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function run(message, data) {
|
||||
if (!volOption || raw === null || raw === undefined || isNaN(Number(raw))) {
|
||||
const currentDefault = set?.get("volume") ?? 100;
|
||||
const currentPlayerVol = Math.round((p.preferredVolume ?? 1) * 100);
|
||||
const pfx = set?.get("prefix") ?? "%";
|
||||
const pfx = this.handler.getPrefix(message.channel?.guildId ?? message.message?.guildId);
|
||||
embed
|
||||
.setTitle(this.t(message, "responses.volumedefault.title"))
|
||||
.setDescription(
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ function buildVotersEmbed(voters, total, page, limit, type, resourceId, expired
|
||||
|
||||
export async function run(msg, data) {
|
||||
const fluxerlist = this.fluxerlist;
|
||||
const prefix = this.handler?.getPrefix?.(msg.message?.guildId) ?? "%";
|
||||
const prefix = this.handler.getPrefix(msg.message?.guildId);
|
||||
const action = data.get("action")?.value ?? "info";
|
||||
const type = data.get("type")?.value ?? "bot";
|
||||
const resourceId = data.get("id")?.value || null;
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@
|
||||
"owners": ["user id for owner-only commands", "another user id"],
|
||||
"playerAFKTimeout": 60000,
|
||||
"Comment": "The above specifies the time in ms after which a player goes inactive; Optional.",
|
||||
"customStatsFooter": "Text shown in the footer of the %stats embed; optional.",
|
||||
"customStatsFooter": "Text shown in the footer of the $prefixstats embed; optional.",
|
||||
"embedColor": "0xe9196c",
|
||||
"logging": {
|
||||
"Comment": "Control which log categories appear in the console. Set 'enabled' to false to silence everything except errors. Set any category to false to silence just that group.",
|
||||
|
||||
@@ -161,6 +161,7 @@ export class Remix {
|
||||
commands.setPrefixManager(prefixMgr);
|
||||
commands.setLocale(this.locale);
|
||||
messages.setLocale(this.locale);
|
||||
this.locale.setPrefixResolver((guildId) => commands.getPrefix(guildId));
|
||||
|
||||
new HelpCommand(commands, messages, (msg) => this.getSettings(msg)).register();
|
||||
|
||||
@@ -687,6 +688,7 @@ export class Remix {
|
||||
moonlink: this.moonlink ?? null,
|
||||
revoice: this.revoice ?? null,
|
||||
settingsMgr: this.settingsMgr ?? this.settings ?? null,
|
||||
getPrefix: (guildId) => this.handler.getPrefix(guildId),
|
||||
observedVoiceUsers: this.observedVoiceUsers ?? null,
|
||||
voiceCache: this.voiceCache ?? null,
|
||||
locale: this.locale ?? null,
|
||||
@@ -819,7 +821,7 @@ export class Remix {
|
||||
if (channels.has(cleanId) && !force) {
|
||||
if (channelMode === "auto") {
|
||||
if (message) {
|
||||
const prefix = (() => { try { return set.get("prefix") ?? "%"; } catch (_) { return "%"; } })();
|
||||
const prefix = this.handler.getPrefix(cleanGuildId);
|
||||
const guildIdForLocale = message?.channel?.channel?.guildId ?? message?.guildId ?? cleanGuildId;
|
||||
message.replyEmbed(
|
||||
this.locale.translate(guildIdForLocale, "responses.leave.autoRejoinHint", {
|
||||
|
||||
@@ -412,7 +412,7 @@ export class CommandHandler extends EventEmitter {
|
||||
_cmdCooldowns = new Map();
|
||||
_cmdCooldownMs = 1500;
|
||||
|
||||
constructor(handler, prefix = "!") {
|
||||
constructor(handler, prefix = "%") {
|
||||
super();
|
||||
this.messages = handler;
|
||||
this.client = handler.client;
|
||||
|
||||
@@ -1111,7 +1111,7 @@ export class GatewayHandler {
|
||||
|
||||
/**
|
||||
* Rejoin a voice channel after an unexpected disconnect.
|
||||
* Used by the %247 auto mode to automatically reconnect.
|
||||
* Used by the $prefix247 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 %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
|
||||
* 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
|
||||
*
|
||||
* Channels are rejoined one at a time with a delay between each to
|
||||
* avoid overwhelming the LiveKit server with concurrent track publications.
|
||||
|
||||
@@ -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 %play lastfm loved/top/recent
|
||||
* - Fetch loved / top / recent tracks for $prefixplay 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 %np embed.
|
||||
* Get track info (play count, tags, etc.) for the $prefixnp 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 `%play lastfm: kendrick lamar luther` where artist/title
|
||||
* Useful for `$prefixplay lastfm: kendrick lamar luther` where artist/title
|
||||
* boundaries are ambiguous.
|
||||
*
|
||||
* @param {string} query
|
||||
@@ -1400,7 +1400,7 @@ export class LastFmManager {
|
||||
const playlists = await this.getPlaylists(userId);
|
||||
const idx = +playlistId - 1;
|
||||
if (idx < 0 || idx >= playlists.length) {
|
||||
throw new Error(`Playlist #${playlistId} not found. You have ${playlists.length} playlist(s). Use \`%lastfm playlists\` to see them.`);
|
||||
throw new Error(`Playlist #${playlistId} not found. You have ${playlists.length} playlist(s). Use the lastfm playlists command to see them.`);
|
||||
}
|
||||
playlistUrl = playlists[idx].url;
|
||||
} else if (String(playlistId).startsWith("http")) {
|
||||
@@ -1476,7 +1476,7 @@ export class LastFmManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user's top albums (for %lastfm play albums).
|
||||
* Get the user's top albums (for $prefixlastfm play albums).
|
||||
* @param {string} userId
|
||||
* @param {string} [period="overall"] - overall | 7day | 1month | 3month | 6month | 12month
|
||||
* @param {number} [limit=20]
|
||||
@@ -1567,7 +1567,7 @@ export class LastFmManager {
|
||||
tracks = tracks.filter(t => !t.now);
|
||||
break;
|
||||
case "playlist":
|
||||
if (!options.playlistId) throw new Error("Playlist ID required. Use `%lastfm playlists` to see your playlists, then `%lastfm play playlist <number>`.");
|
||||
if (!options.playlistId) throw new Error("Playlist ID required. Use the lastfm playlists command to see your playlists, then use the lastfm play playlist command with a number.");
|
||||
tracks = await this.getPlaylistTracks(userId, options.playlistId, limit);
|
||||
break;
|
||||
case "albums":
|
||||
|
||||
+7
-24
@@ -362,6 +362,7 @@ export default class Player extends EventEmitter {
|
||||
this.config = opts.config ?? {};
|
||||
this.settings = opts.settings ?? null;
|
||||
this.settingsMgr = opts.settingsMgr ?? null;
|
||||
this._getPrefix = opts.getPrefix ?? null;
|
||||
this._observedVoiceUsers = opts.observedVoiceUsers ?? null;
|
||||
this._voiceCache = opts.voiceCache ?? null;
|
||||
this.locale = opts.locale ?? null;
|
||||
@@ -414,9 +415,9 @@ export default class Player extends EventEmitter {
|
||||
* Get the 24/7 mode for this player's channel.
|
||||
* Returns "auto", "on", or "off".
|
||||
*
|
||||
* %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
|
||||
* $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
|
||||
*/
|
||||
_get247Mode() {
|
||||
if (!this._guildId) return "off";
|
||||
@@ -1389,13 +1390,7 @@ export default class Player extends EventEmitter {
|
||||
this._queueEndedSent = true;
|
||||
this.emit("queueEnd");
|
||||
if (!this._autoplay) {
|
||||
const prefix = (() => {
|
||||
try {
|
||||
return this.settingsMgr?.getServer?.(this._guildId)?.get?.("prefix")
|
||||
?? this.settings?.get?.("prefix")
|
||||
?? "%";
|
||||
} catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = this._getPrefix?.(this._guildId) ?? "%";
|
||||
this.emit("message", { ...mkEmbed(this._t("responses._common.queueEnded", { prefix })), system: true });
|
||||
}
|
||||
}
|
||||
@@ -1432,13 +1427,7 @@ export default class Player extends EventEmitter {
|
||||
this._queueEndedSent = true;
|
||||
this.emit("queueEnd");
|
||||
if (!this._autoplay) {
|
||||
const prefix = (() => {
|
||||
try {
|
||||
return this.settingsMgr?.getServer?.(this._guildId)?.get?.("prefix")
|
||||
?? this.settings?.get?.("prefix")
|
||||
?? "%";
|
||||
} catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = this._getPrefix?.(this._guildId) ?? "%";
|
||||
this.emit("message", { ...mkEmbed(this._t("responses._common.queueEnded", { prefix })), system: true });
|
||||
}
|
||||
}
|
||||
@@ -2131,13 +2120,7 @@ export default class Player extends EventEmitter {
|
||||
|
||||
if (!this._wasRadio && !this._queueEndedSent && !this._autoplay) {
|
||||
this._queueEndedSent = true;
|
||||
const prefix = (() => {
|
||||
try {
|
||||
return this.settingsMgr?.getServer?.(this._guildId)?.get?.("prefix")
|
||||
?? this.settings?.get?.("prefix")
|
||||
?? "%";
|
||||
} catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = this._getPrefix?.(this._guildId) ?? "%";
|
||||
this.emit("message", { ...mkEmbed(this._t("responses._common.queueEnded", { prefix })), system: true });
|
||||
}
|
||||
this._wasRadio = false;
|
||||
|
||||
+7
-12
@@ -624,11 +624,7 @@ export class PlayerManager {
|
||||
});
|
||||
}
|
||||
|
||||
const prefix = (() => {
|
||||
try {
|
||||
return this.settings.getServer(guildId)?.get("prefix") ?? "%";
|
||||
} catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = this.commands.getPrefix(guildId);
|
||||
message.reply(mkEmbed(this._t(message, "responses._common.alreadyInChannel", { channels: channelList, prefix })));
|
||||
return null;
|
||||
}
|
||||
@@ -830,6 +826,7 @@ export class PlayerManager {
|
||||
moonlink: this.playerConfig?.moonlink ?? null,
|
||||
revoice: this.playerConfig?.revoice ?? null,
|
||||
settingsMgr: this.settings,
|
||||
getPrefix: (guildId) => this.commands.getPrefix(guildId),
|
||||
observedVoiceUsers: this.observedVoiceUsers ?? null,
|
||||
voiceCache: this.voiceCache ?? null,
|
||||
locale: this.locale ?? null,
|
||||
@@ -889,17 +886,15 @@ export class PlayerManager {
|
||||
if (homeChannelId !== activeChannelId) this.playerMap.delete(homeChannelId);
|
||||
player.destroy();
|
||||
|
||||
const prefix = (() => {
|
||||
try { return this.settings.getServer(guildId)?.get("prefix") ?? "%"; } catch (_) { return "%"; }
|
||||
})();
|
||||
const prefix = this.commands.getPrefix(guildId);
|
||||
|
||||
let desc;
|
||||
if (mode247 === "on") {
|
||||
desc = this.locale?.translate(guildId, "responses.join.autoLeave247On", { channel: `<#${activeChannelId}>` })
|
||||
?? `Left channel <#${activeChannelId}> because of inactivity.\nI'll rejoin automatically when the bot restarts (%247 on mode).`;
|
||||
desc = this.locale?.translate(guildId, "responses.join.autoLeave247On", { channel: `<#${activeChannelId}>`, prefix })
|
||||
?? `Left channel <#${activeChannelId}> because of inactivity.\nI'll rejoin automatically when the bot restarts (${prefix}247 on mode).`;
|
||||
} else if (mode247 === "auto") {
|
||||
desc = this.locale?.translate(guildId, "responses.join.autoLeave247Auto", { channel: `<#${activeChannelId}>` })
|
||||
?? `Left channel <#${activeChannelId}> — reconnecting automatically (%247 auto mode)...`;
|
||||
desc = this.locale?.translate(guildId, "responses.join.autoLeave247Auto", { channel: `<#${activeChannelId}>`, prefix })
|
||||
?? `Left channel <#${activeChannelId}> — reconnecting automatically (${prefix}247 auto mode)...`;
|
||||
} else {
|
||||
desc = this.locale?.translate(guildId, "responses.join.autoLeaveInactive247", { channel: `<#${activeChannelId}>`, prefix })
|
||||
?? `Left channel <#${activeChannelId}> because of inactivity.\nIf you want me to stay in voice, use \`${prefix}247 on/auto\``;
|
||||
|
||||
@@ -25,6 +25,8 @@ export class Locale {
|
||||
this.defaultLocale = "en";
|
||||
/** settingsMgr reference — set after construction via bind() */
|
||||
this.settingsMgr = null;
|
||||
/** getPrefix callback — set by CommandHandler so prefix logic lives in one place */
|
||||
this._getPrefixFn = null;
|
||||
/** Maximum guild locale cache size */
|
||||
this._maxResolvedCache = 5000;
|
||||
}
|
||||
@@ -131,6 +133,33 @@ export class Locale {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the prefix resolver callback. Called once by CommandHandler at startup
|
||||
* so that all prefix resolution goes through CommandHandler.getPrefix().
|
||||
* @param {(guildId: string) => string} fn
|
||||
*/
|
||||
setPrefixResolver(fn) {
|
||||
this._getPrefixFn = fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the per-guild prefix. Delegates to CommandHandler.getPrefix() when
|
||||
* available, otherwise falls back to a direct settings lookup.
|
||||
* @param {string} guildId
|
||||
* @returns {string}
|
||||
*/
|
||||
_getPrefix(guildId) {
|
||||
if (this._getPrefixFn) return this._getPrefixFn(guildId);
|
||||
try {
|
||||
const serverSettings = this.settingsMgr?.getServer?.(guildId);
|
||||
if (serverSettings) {
|
||||
const prefix = serverSettings.get("prefix");
|
||||
if (prefix) return prefix;
|
||||
}
|
||||
} catch (_) {}
|
||||
return "%";
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up a dotted key in a nested object.
|
||||
* @param {Object} obj
|
||||
@@ -175,6 +204,11 @@ export class Locale {
|
||||
);
|
||||
}
|
||||
|
||||
if (value.includes("$prefix")) {
|
||||
const prefix = this._getPrefix(guildId);
|
||||
value = value.replace(/\$prefix/gi, prefix);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,10 @@
|
||||
"prefix": "The prefix used to trigger commands.",
|
||||
"pfp": "What profile picture the bot should use. Presets: `default | dark | light | mono | <custom url>`.",
|
||||
"locale": "The preferred language of your server.",
|
||||
"stay_247": "24/7 saved voice channels for this server. Supports multiple channels and is managed automatically by %247 — do not edit manually.",
|
||||
"stay_247": "24/7 saved voice channels for this server. Supports multiple channels and is managed automatically by $prefix247 — do not edit manually.",
|
||||
"stay_247_mode": "Legacy guild-wide 24/7 mode. Superseded by stay_247_modes (per-channel). Kept for backward compatibility.",
|
||||
"stay_247_modes": "Per-channel 24/7 mode map. Format: {\"channelId\": \"on\"|\"auto\"|\"off\"}. Managed automatically by %247 — do not edit manually.",
|
||||
"volume": "The default playback volume for this server (1-200). Saved automatically when you use %volume. Restored every time the bot joins a channel.",
|
||||
"stay_247_modes": "Per-channel 24/7 mode map. Format: {\"channelId\": \"on\"|\"auto\"|\"off\"}. Managed automatically by $prefix247 — do not edit manually.",
|
||||
"volume": "The default playback volume for this server (1-200). Saved automatically when you use $prefixvolume. Restored every time the bot joins a channel.",
|
||||
"announcementChannelId": "The channel where song announcements are sent. Managed automatically — do not edit manually."
|
||||
}
|
||||
}
|
||||
@@ -60,8 +60,8 @@
|
||||
"pause": "إيقاف التشغيل مؤقتاً في قناتك الصوتية.",
|
||||
"play": "شغّل أغنية أو قائمة تشغيل من رابط أو استعلام بحث.\nيدعم يوتيوب وسبوتيفاي وساوندكلاود ودييزر وآبل ميوزيك وتايدال والمزيد.\nالبحث الافتراضي: YouTube Music. استخدم `-p <المزود>` أو بادئة مضمنة مثل `sp: blinding lights`.",
|
||||
"player": "أنشئ لوحة تحكم تشغيل تفاعلية مع تقدم مباشر.",
|
||||
"playnext": "مثل %play لكنه يضيف النتيجة إلى أعلى قائمة الانتظار.",
|
||||
"radio": "شغّل محطة إذاعية. استخدم `%radio list` لتصفح جميع المحطات.",
|
||||
"playnext": "مثل $prefixplay لكنه يضيف النتيجة إلى أعلى قائمة الانتظار.",
|
||||
"radio": "شغّل محطة إذاعية. استخدم `$prefixradio list` لتصفح جميع المحطات.",
|
||||
"reload": "إعادة تحميل الأوامر أو وحدات src أو وحدات audio. اتركه فارغاً لعرض جميع الأهداف.",
|
||||
"remove": "أزل أغنية محددة من قائمة الانتظار.",
|
||||
"resume": "استئناف التشغيل في قناتك الصوتية.",
|
||||
@@ -274,7 +274,7 @@
|
||||
"description": "أضف Remix إلى خادمك مباشرة من [FluxerList](<https://fluxerlist.com/bots/remix>).\n\nانضم إلى مجتمعنا على [fluxer.gg/remix](https://fluxer.gg/remix) للحصول على الدعم والتحديثات والتعليقات المباشرة."
|
||||
},
|
||||
"join": {
|
||||
"channelNotFound": "لم أتمكن من العثور على القناة `{{channel}}`\nاستخدم أمر المساعدة لمعرفة المزيد. (`%help join`)",
|
||||
"channelNotFound": "لم أتمكن من العثور على القناة `{{channel}}`\nاستخدم أمر المساعدة لمعرفة المزيد. (`$prefixhelp join`)",
|
||||
"alreadyJoined": "منضم بالفعل إلى <#{{channel}}>.",
|
||||
"audioNodeConnecting": "⚠️ عقدة الصوت لا تزال تتصل — يرجى المحاولة مرة أخرى بعد بضع ثوانٍ.",
|
||||
"joining": "⏳ جارٍ الانضمام إلى القناة...",
|
||||
@@ -416,9 +416,9 @@
|
||||
"stationsTitle": "📻 **المحطات الإذاعية (صفحة {{page}}/{{total}})**",
|
||||
"timedOut": "📻 انتهت مهلة اختيار الإذاعة.",
|
||||
"cancelled": "❌ تم إلغاء اختيار الإذاعة.",
|
||||
"unknownStation": "❌ محطة غير معروفة `{{station}}`. المتاحة: {{stations}}\n\nاستخدم `%radio list` للتصفح.",
|
||||
"unknownStation": "❌ محطة غير معروفة `{{station}}`. المتاحة: {{stations}}\n\nاستخدم `$prefixradio list` للتصفح.",
|
||||
"nowPlaying": "📻 بث مباشر _{{title}}_ لـ [{{author}}]({{url}}) في <#{{channel}}>",
|
||||
"skipHint": "_استخدم `%skip` لإيقاف الإذاعة، أو `%radio list` لتبديل المحطات._",
|
||||
"skipHint": "_استخدم `$prefixskip` لإيقاف الإذاعة، أو `$prefixradio list` لتبديل المحطات._",
|
||||
"prevNext": "⬅️ السابق ➡️ التالي ❌ إلغاء"
|
||||
},
|
||||
"reload": {
|
||||
@@ -429,9 +429,9 @@
|
||||
"reloaded": "✅ `{{name}}`",
|
||||
"fileNotFound": "❌ الملف غير موجود: `{{label}}`",
|
||||
"moduleError": "❌ `{{label}}`: {{error}}",
|
||||
"unknownTarget": "❌ هدف غير معروف `{{target}}`.\nشغّل `%reload` بدون وسائط لعرض جميع الأهداف القابلة لإعادة التحميل.",
|
||||
"unknownTarget": "❌ هدف غير معروف `{{target}}`.\nشغّل `$prefixreload` بدون وسائط لعرض جميع الأهداف القابلة لإعادة التحميل.",
|
||||
"availableTargetsTitle": "🔄 إعادة التحميل — الأهداف المتاحة",
|
||||
"runHint": "شغّل `%reload <هدف>` أو استخدم كلمة دفعية:",
|
||||
"runHint": "شغّل `$prefixreload <هدف>` أو استخدم كلمة دفعية:",
|
||||
"batchKeywords": "`all` · `commands` · `src` · `audio`",
|
||||
"resultsHeader": "✅ **{{ok}}** تمت إعادة التحميل · ❌ **{{bad}}** فشل"
|
||||
},
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
"pause": "پەخشکردنەکە لە کەناڵی دەنگیت وەستێنە.",
|
||||
"play": "گۆرانییەک یان لیستی پەخش بەستەرێکەوە یان بە پرسیارێکی گەڕان پەخش بکە.\nپشتگیری YouTube، Spotify، SoundCloud، Deezer، Apple Music، Tidal و زیاتر دەکات.\nگەڕانی بنەڕەتی: YouTube Music. `-p <provider>` یان پێشگر بەکاربهێنە وەک `sp: blinding lights`.",
|
||||
"player": "پانێلی کۆنتڕۆڵی پەخشکەری تەواوکەری هاوئاهەنگ دروست بکە.",
|
||||
"playnext": "وەک %play بەڵام ئەنجامەکە لە سەرەوەی ڕیزبەندییەکە زیاد دەکرێت.",
|
||||
"radio": "ستەیشنی ڕادیۆ پەخش بکە. `%radio list` بەکاربهێنە بۆ بینینی هەموو ستەیشنەکان.",
|
||||
"playnext": "وەک $prefixplay بەڵام ئەنجامەکە لە سەرەوەی ڕیزبەندییەکە زیاد دەکرێت.",
|
||||
"radio": "ستەیشنی ڕادیۆ پەخش بکە. `$prefixradio list` بەکاربهێنە بۆ بینینی هەموو ستەیشنەکان.",
|
||||
"reload": "فەرمانەکان، یان مۆدیولەکانی src، یان مۆدیولەکانی audio بارکردنەوە بکە. بەتاڵی بهێڵە بۆ بینینی هەموو ئامانجەکان.",
|
||||
"remove": "گۆرانییەکی دیاریکراو لە ڕیزبەندییەکە دەربهێنە.",
|
||||
"resume": "پەخشکردنەکە لە کەناڵی دەنگیت بەردەوامبکە.",
|
||||
@@ -274,7 +274,7 @@
|
||||
"description": "Remix زیاد بکە بۆ سێرڤەرەکەت لەڕێگەی [FluxerList](<https://fluxerlist.com/bots/remix>).\n\nبەشداری کۆمەڵگەکەمان بکە لە [fluxer.gg/remix](https://fluxer.gg/remix) بۆ پشتگیری، نوێکارییەکان، و ڕاوبۆچوونی ڕاستەوخۆ."
|
||||
},
|
||||
"join": {
|
||||
"channelNotFound": "نەتوانرا کەناڵ `{{channel}}` بدۆزرێتەوە\nفەرمانی یارمەتی بەکاربهێنە بۆ زانینی زیاتر. (`%help join`)",
|
||||
"channelNotFound": "نەتوانرا کەناڵ `{{channel}}` بدۆزرێتەوە\nفەرمانی یارمەتی بەکاربهێنە بۆ زانینی زیاتر. (`$prefixhelp join`)",
|
||||
"alreadyJoined": "پێشتر بەشداری <#{{channel}}> کرا.",
|
||||
"audioNodeConnecting": "⚠️ گرێی دەنگ هێشتا پەیوەندی دەکات — تکایە چەند چرکەیەک دووبارە هەوڵبدەرەوە.",
|
||||
"joining": "⏳ بەشداریکردنی کەناڵ...",
|
||||
@@ -416,9 +416,9 @@
|
||||
"stationsTitle": "📻 **ستەیشنەکانی ڕادیۆ (لاپەڕە {{page}}/{{total}})**",
|
||||
"timedOut": "📻 کاتی هەڵبژاردنی ڕادیۆ تەواو بوو.",
|
||||
"cancelled": "❌ هەڵبژاردنی ڕادیۆ هەڵوەشایەوە.",
|
||||
"unknownStation": "❌ ستەیشنی نەناسراو `{{station}}`. بەردەستەکان: {{stations}}\n\n`%radio list` بەکاربهێنە بۆ بینین.",
|
||||
"unknownStation": "❌ ستەیشنی نەناسراو `{{station}}`. بەردەستەکان: {{stations}}\n\n`$prefixradio list` بەکاربهێنە بۆ بینین.",
|
||||
"nowPlaying": "📻 پەخشی ڕاستەوخۆ _{{title}}_ لەلایەن [{{author}}]({{url}}) لە <#{{channel}}>",
|
||||
"skipHint": "_`%skip` بەکاربهێنە بۆ وەستاندنی ڕادیۆ، یان `%radio list` بۆ گۆڕینی ستەیشنەکان._",
|
||||
"skipHint": "_`$prefixskip` بەکاربهێنە بۆ وەستاندنی ڕادیۆ، یان `$prefixradio list` بۆ گۆڕینی ستەیشنەکان._",
|
||||
"prevNext": "⬅️ پێشوو ➡️ دواتر ❌ پاشگەزبوونەوە"
|
||||
},
|
||||
"reload": {
|
||||
@@ -429,9 +429,9 @@
|
||||
"reloaded": "✅ `{{name}}`",
|
||||
"fileNotFound": "❌ فایلەکە نەدۆزرایەوە: `{{label}}`",
|
||||
"moduleError": "❌ `{{label}}`: {{error}}",
|
||||
"unknownTarget": "❌ ئامانجی نەناسراو `{{target}}`.\n`%reload` بەبێ ئارگومێنت بەکاربهێنە بۆ بینینی هەموو ئامانجەکان.",
|
||||
"unknownTarget": "❌ ئامانجی نەناسراو `{{target}}`.\n`$prefixreload` بەبێ ئارگومێنت بەکاربهێنە بۆ بینینی هەموو ئامانجەکان.",
|
||||
"availableTargetsTitle": "🔄 بارکردنەوە — ئامانجە بەردەستەکان",
|
||||
"runHint": "`%reload <ئامانج>` بەکاربهێنە یان وشەیەکی گرووپی بەکاربهێنە:",
|
||||
"runHint": "`$prefixreload <ئامانج>` بەکاربهێنە یان وشەیەکی گرووپی بەکاربهێنە:",
|
||||
"batchKeywords": "`all` · `commands` · `src` · `audio`",
|
||||
"resultsHeader": "✅ **{{ok}}** بارکرانەوە · ❌ **{{bad}}** سەرکەوتوو نەبوون"
|
||||
},
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
"pause": "Pausiere die Wiedergabe in deinem Sprachkanal.",
|
||||
"play": "Spiele einen Song oder eine Playlist von einer URL oder Suchanfrage.\nUnterstützt YouTube, Spotify, SoundCloud, Deezer, Apple Music, Tidal und mehr.\nStandardsuche: YouTube Music. Nutze `-p <Anbieter>` oder Inline-Präfix wie `sp: blinding lights`.",
|
||||
"player": "Erstelle ein interaktives Wiedergabe-Kontrollfeld mit Live-Fortschritt.",
|
||||
"playnext": "Wie %play, fügt das Ergebnis aber an den Anfang der Warteschlange hinzu.",
|
||||
"radio": "Spiele einen Radiosender. Nutze `%radio list`, um alle Sender zu durchsuchen.",
|
||||
"playnext": "Wie $prefixplay, fügt das Ergebnis aber an den Anfang der Warteschlange hinzu.",
|
||||
"radio": "Spiele einen Radiosender. Nutze `$prefixradio list`, um alle Sender zu durchsuchen.",
|
||||
"reload": "Lade Befehle, src-Module oder Audio-Module neu. Leer lassen, um alle Ziele anzuzeigen.",
|
||||
"remove": "Entferne einen bestimmten Song aus der Warteschlange.",
|
||||
"resume": "Setze die Wiedergabe in deinem Sprachkanal fort.",
|
||||
@@ -274,7 +274,7 @@
|
||||
"description": "Füge Remix direkt über [FluxerList](<https://fluxerlist.com/bots/remix>) zu deinem Server hinzu.\n\nTritt unserer Community auf [fluxer.gg/remix](https://fluxer.gg/remix) für Support, Updates und Feedback bei."
|
||||
},
|
||||
"join": {
|
||||
"channelNotFound": "Konnte den Kanal `{{channel}}` nicht finden.\nNutze den Hilfe-Befehl für mehr Infos. (`%help join`)",
|
||||
"channelNotFound": "Konnte den Kanal `{{channel}}` nicht finden.\nNutze den Hilfe-Befehl für mehr Infos. (`$prefixhelp join`)",
|
||||
"alreadyJoined": "Bereits in <#{{channel}}>.",
|
||||
"audioNodeConnecting": "⚠️ Audio-Knoten verbindet noch — bitte versuche es in wenigen Sekunden erneut.",
|
||||
"joining": "⏳ Trete Kanal bei...",
|
||||
@@ -416,9 +416,9 @@
|
||||
"stationsTitle": "📻 **Radiosender (Seite {{page}}/{{total}})**",
|
||||
"timedOut": "📻 Radio-Auswahl abgelaufen.",
|
||||
"cancelled": "❌ Radio-Auswahl abgebrochen.",
|
||||
"unknownStation": "❌ Unbekannter Sender `{{station}}`. Verfügbar: {{stations}}\n\nNutze `%radio list` zum Durchsuchen.",
|
||||
"unknownStation": "❌ Unbekannter Sender `{{station}}`. Verfügbar: {{stations}}\n\nNutze `$prefixradio list` zum Durchsuchen.",
|
||||
"nowPlaying": "📻 Streamt jetzt _{{title}}_ von [{{author}}]({{url}}) in <#{{channel}}>",
|
||||
"skipHint": "_Nutze `%skip`, um das Radio zu stoppen, oder `%radio list`, um Sender zu wechseln._",
|
||||
"skipHint": "_Nutze `$prefixskip`, um das Radio zu stoppen, oder `$prefixradio list`, um Sender zu wechseln._",
|
||||
"prevNext": "⬅️ Zurück ➡️ Weiter ❌ Abbrechen"
|
||||
},
|
||||
"reload": {
|
||||
@@ -429,9 +429,9 @@
|
||||
"reloaded": "✅ `{{name}}`",
|
||||
"fileNotFound": "❌ Datei nicht gefunden: `{{label}}`",
|
||||
"moduleError": "❌ `{{label}}`: {{error}}",
|
||||
"unknownTarget": "❌ Unbekanntes Ziel `{{target}}`.\nFühre `%reload` ohne Argumente aus, um alle neuladbaren Ziele zu sehen.",
|
||||
"unknownTarget": "❌ Unbekanntes Ziel `{{target}}`.\nFühre `$prefixreload` ohne Argumente aus, um alle neuladbaren Ziele zu sehen.",
|
||||
"availableTargetsTitle": "🔄 Neu laden — Verfügbare Ziele",
|
||||
"runHint": "Führe `%reload <Ziel>` aus oder nutze ein Stichwort:",
|
||||
"runHint": "Führe `$prefixreload <Ziel>` aus oder nutze ein Stichwort:",
|
||||
"batchKeywords": "`all` · `commands` · `src` · `audio`",
|
||||
"resultsHeader": "✅ **{{ok}}** neu geladen · ❌ **{{bad}}** fehlgeschlagen"
|
||||
},
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
"pause": "Pause the playback in your voice channel.",
|
||||
"play": "Play a song or playlist from a URL or search query.\nSupports YouTube, Spotify, SoundCloud, Deezer, Apple Music, Tidal, and more.\nDefault search: YouTube Music. Use `-p <provider>` or inline prefix e.g. `sp: blinding lights`.",
|
||||
"player": "Create an interactive player control panel with live progress.",
|
||||
"playnext": "Same as %play but adds the result to the top of the queue.",
|
||||
"radio": "Play a radio station. Use `%radio list` to browse all stations.",
|
||||
"playnext": "Same as $prefixplay but adds the result to the top of the queue.",
|
||||
"radio": "Play a radio station. Use `$prefixradio list` to browse all stations.",
|
||||
"reload": "Reload commands, src modules, or audio modules. Leave blank to see all targets.",
|
||||
"remove": "Remove a specific song from the queue.",
|
||||
"resume": "Resume the playback in your voice channel.",
|
||||
@@ -277,7 +277,7 @@
|
||||
"description": "Add Remix to your server directly from [FluxerList](<https://fluxerlist.com/bots/remix>).\n\nJoin our community at [fluxer.gg/remix](https://fluxer.gg/remix) for support, updates, and direct feedback."
|
||||
},
|
||||
"join": {
|
||||
"channelNotFound": "Couldn't find the channel `{{channel}}`\nUse the help command to learn more about this. (`%help join`)",
|
||||
"channelNotFound": "Couldn't find the channel `{{channel}}`\nUse the help command to learn more about this. (`$prefixhelp join`)",
|
||||
"alreadyJoined": "Already joined <#{{channel}}>.",
|
||||
"audioNodeConnecting": "⚠️ Audio node is still connecting — please try again in a few seconds.",
|
||||
"joining": "⏳ Joining Channel...",
|
||||
@@ -524,9 +524,9 @@
|
||||
"stationsTitle": "📻 **Radio Stations (Page {{page}}/{{total}})**",
|
||||
"timedOut": "📻 Radio selection timed out.",
|
||||
"cancelled": "❌ Radio selection cancelled.",
|
||||
"unknownStation": "❌ Unknown station `{{station}}`. Available: {{stations}}\n\nUse `%radio list` to browse.",
|
||||
"unknownStation": "❌ Unknown station `{{station}}`. Available: {{stations}}\n\nUse `$prefixradio list` to browse.",
|
||||
"nowPlaying": "📻 Now streaming _{{title}}_ by [{{author}}]({{url}}) in <#{{channel}}>",
|
||||
"skipHint": "_Use `%skip` to stop the radio, or `%radio list` to switch stations._",
|
||||
"skipHint": "_Use `$prefixskip` to stop the radio, or `$prefixradio list` to switch stations._",
|
||||
"prevNext": "⬅️ Previous ➡️ Next ❌ Cancel"
|
||||
},
|
||||
"reload": {
|
||||
@@ -537,9 +537,9 @@
|
||||
"reloaded": "✅ `{{name}}`",
|
||||
"fileNotFound": "❌ File not found: `{{label}}`",
|
||||
"moduleError": "❌ `{{label}}`: {{error}}",
|
||||
"unknownTarget": "❌ Unknown target `{{target}}`.\nRun `%reload` with no arguments to see all reloadable targets.",
|
||||
"unknownTarget": "❌ Unknown target `{{target}}`.\nRun `$prefixreload` with no arguments to see all reloadable targets.",
|
||||
"availableTargetsTitle": "🔄 Reload — Available Targets",
|
||||
"runHint": "Run `%reload <target>` or use a batch keyword:",
|
||||
"runHint": "Run `$prefixreload <target>` or use a batch keyword:",
|
||||
"batchKeywords": "`all` · `commands` · `src` · `audio`",
|
||||
"resultsHeader": "✅ **{{ok}}** reloaded · ❌ **{{bad}}** failed"
|
||||
},
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
"pause": "Pause a reprodução no seu canal de voz.",
|
||||
"play": "Toque uma música ou playlist a partir de uma URL ou consulta de busca.\nSuporta YouTube, Spotify, SoundCloud, Deezer, Apple Music, Tidal e mais.\nBusca padrão: YouTube Music. Use `-p <provedor>` ou prefixo inline como `sp: blinding lights`.",
|
||||
"player": "Crie um painel de controle interativo com progresso ao vivo.",
|
||||
"playnext": "Igual ao %play, mas adiciona o resultado ao topo da fila.",
|
||||
"radio": "Toque uma estação de rádio. Use `%radio list` para ver todas as estações.",
|
||||
"playnext": "Igual ao $prefixplay, mas adiciona o resultado ao topo da fila.",
|
||||
"radio": "Toque uma estação de rádio. Use `$prefixradio list` para ver todas as estações.",
|
||||
"reload": "Recarregue comandos, módulos src ou módulos de áudio. Deixe vazio para ver todos os alvos.",
|
||||
"remove": "Remova uma música específica da fila.",
|
||||
"resume": "Retome a reprodução no seu canal de voz.",
|
||||
@@ -274,7 +274,7 @@
|
||||
"description": "Adicione o Remix ao seu servidor diretamente pelo [FluxerList](<https://fluxerlist.com/bots/remix>).\n\nJunte-se à nossa comunidade em [fluxer.gg/remix](https://fluxer.gg/remix) para suporte, atualizações e feedback direto."
|
||||
},
|
||||
"join": {
|
||||
"channelNotFound": "Não foi possível encontrar o canal `{{channel}}`\nUse o comando de ajuda para saber mais. (`%help join`)",
|
||||
"channelNotFound": "Não foi possível encontrar o canal `{{channel}}`\nUse o comando de ajuda para saber mais. (`$prefixhelp join`)",
|
||||
"alreadyJoined": "Já entrou em <#{{channel}}>.",
|
||||
"audioNodeConnecting": "⚠️ O nó de áudio ainda está conectando — por favor, tente novamente em alguns segundos.",
|
||||
"joining": "⏳ Entrando no canal...",
|
||||
@@ -416,9 +416,9 @@
|
||||
"stationsTitle": "📻 **Estações de Rádio (Página {{page}}/{{total}})**",
|
||||
"timedOut": "📻 Tempo de seleção de rádio esgotado.",
|
||||
"cancelled": "❌ Seleção de rádio cancelada.",
|
||||
"unknownStation": "❌ Estação desconhecida `{{station}}`. Disponíveis: {{stations}}\n\nUse `%radio list` para navegar.",
|
||||
"unknownStation": "❌ Estação desconhecida `{{station}}`. Disponíveis: {{stations}}\n\nUse `$prefixradio list` para navegar.",
|
||||
"nowPlaying": "📻 Transmitindo agora _{{title}}_ por [{{author}}]({{url}}) em <#{{channel}}>",
|
||||
"skipHint": "_Use `%skip` para parar o rádio ou `%radio list` para trocar de estação._",
|
||||
"skipHint": "_Use `$prefixskip` para parar o rádio ou `$prefixradio list` para trocar de estação._",
|
||||
"prevNext": "⬅️ Anterior ➡️ Próximo ❌ Cancelar"
|
||||
},
|
||||
"reload": {
|
||||
@@ -429,9 +429,9 @@
|
||||
"reloaded": "✅ `{{name}}`",
|
||||
"fileNotFound": "❌ Arquivo não encontrado: `{{label}}`",
|
||||
"moduleError": "❌ `{{label}}`: {{error}",
|
||||
"unknownTarget": "❌ Alvo desconhecido `{{target}}`.\nExecute `%reload` sem argumentos para ver todos os alvos recarregáveis.",
|
||||
"unknownTarget": "❌ Alvo desconhecido `{{target}}`.\nExecute `$prefixreload` sem argumentos para ver todos os alvos recarregáveis.",
|
||||
"availableTargetsTitle": "🔄 Recarregar — Alvos Disponíveis",
|
||||
"runHint": "Execute `%reload <alvo>` ou use uma palavra-chave em lote:",
|
||||
"runHint": "Execute `$prefixreload <alvo>` ou use uma palavra-chave em lote:",
|
||||
"batchKeywords": "`all` · `commands` · `src` · `audio`",
|
||||
"resultsHeader": "✅ **{{ok}}** recarregados · ❌ **{{bad}}** falharam"
|
||||
},
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
"pause": "Ses kanalınızdaki çalmayı duraklatın.",
|
||||
"play": "Bir URL veya arama sorgusundan şarkı veya çalma listesi çalın.\nYouTube, Spotify, SoundCloud, Deezer, Apple Music, Tidal ve daha fazlasını destekler.\nVarsayılan arama: YouTube Music. `-p <sağlayıcı>` veya `sp: blinding lights` gibi satır içi önek kullanın.",
|
||||
"player": "Canlı ilerleme çubuğlu etkileşimli bir oynatıcı kontrol paneli oluşturun.",
|
||||
"playnext": "%play ile aynıdır, ancak sonucu kuyruğun en üstüne ekler.",
|
||||
"radio": "Bir radyo istasyonu çalın. Tüm istasyonları görüntülemek için `%radio list` kullanın.",
|
||||
"playnext": "$prefixplay ile aynıdır, ancak sonucu kuyruğun en üstüne ekler.",
|
||||
"radio": "Bir radyo istasyonu çalın. Tüm istasyonları görüntülemek için `$prefixradio list` kullanın.",
|
||||
"reload": "Komutları, kaynak modüllerini veya ses modüllerini yeniden yükleyin. Tüm hedefleri görmek için boş bırakın.",
|
||||
"remove": "Kuyruktan belirli bir şarkıyı kaldırın.",
|
||||
"resume": "Ses kanalınızdaki çalmayı devam ettirin.",
|
||||
@@ -274,7 +274,7 @@
|
||||
"description": "Remix'i doğrudan [FluxerList](<https://fluxerlist.com/bots/remix>) üzerinden sunucunuza ekleyin.\n\nDestek, güncellemeler ve doğrudan geri bildirim için [fluxer.gg/remix](https://fluxer.gg/remix) topluluğumuza katılın."
|
||||
},
|
||||
"join": {
|
||||
"channelNotFound": "`{{channel}}` kanalı bulunamadı\nBu komut hakkında daha fazla bilgi için yardım komutunu kullanın. (`%help join`)",
|
||||
"channelNotFound": "`{{channel}}` kanalı bulunamadı\nBu komut hakkında daha fazla bilgi için yardım komutunu kullanın. (`$prefixhelp join`)",
|
||||
"alreadyJoined": "Zaten <#{{channel}}> kanalına katıldınız.",
|
||||
"audioNodeConnecting": "⚠️ Ses düğümü hala bağlanıyor — lütfen birkaç saniye sonra tekrar deneyin.",
|
||||
"joining": "⏳ Kanala katılıyor...",
|
||||
@@ -513,9 +513,9 @@
|
||||
"stationsTitle": "📻 **Radyo İstasyonları (Sayfa {{page}}/{{total}})**",
|
||||
"timedOut": "📻 Radyo seçimi zaman aşımına uğradı.",
|
||||
"cancelled": "❌ Radyo seçimi iptal edildi.",
|
||||
"unknownStation": "❌ Bilinmeyen istasyon `{{station}}`. Kullanılabilir: {{stations}}\n\nGörüntülemek için `%radio list` kullanın.",
|
||||
"unknownStation": "❌ Bilinmeyen istasyon `{{station}}`. Kullanılabilir: {{stations}}\n\nGörüntülemek için `$prefixradio list` kullanın.",
|
||||
"nowPlaying": "📻 <#{{channel}}> kanalında [{{author}}]({{url}}) tarafından _{{title}}_ yayınlanıyor",
|
||||
"skipHint": "_Radyoyu durdurmak için `%skip` veya istasyon değiştirmek için `%radio list` kullanın._",
|
||||
"skipHint": "_Radyoyu durdurmak için `$prefixskip` veya istasyon değiştirmek için `$prefixradio list` kullanın._",
|
||||
"prevNext": "⬅️ Önceki ➡️ Sonraki ❌ İptal"
|
||||
},
|
||||
"reload": {
|
||||
@@ -526,9 +526,9 @@
|
||||
"reloaded": "✅ `{{name}}`",
|
||||
"fileNotFound": "❌ Dosya bulunamadı: `{{label}}`",
|
||||
"moduleError": "❌ `{{label}}`: {{error}}",
|
||||
"unknownTarget": "❌ Bilinmeyen hedef `{{target}}`.\nTüm yeniden yüklenebilir hedefleri görmek için `%reload`'u argüman olmadan çalıştırın.",
|
||||
"unknownTarget": "❌ Bilinmeyen hedef `{{target}}`.\nTüm yeniden yüklenebilir hedefleri görmek için `$prefixreload`'u argüman olmadan çalıştırın.",
|
||||
"availableTargetsTitle": "🔄 Yeniden Yükle — Kullanılabilir Hedefler",
|
||||
"runHint": "`%reload <hedef>` çalıştırın veya bir toplu anahtar kelime kullanın:",
|
||||
"runHint": "`$prefixreload <hedef>` çalıştırın veya bir toplu anahtar kelime kullanın:",
|
||||
"batchKeywords": "`all` · `commands` · `src` · `audio`",
|
||||
"resultsHeader": "✅ **{{ok}}** yeniden yüklendi · ❌ **{{bad}}** başarısız"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user