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
@@ -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", {
|
||||
|
||||
Reference in new issue
Block a user