kythia-core 0.12.5-beta → 0.12.7-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Kythia.d.ts +7 -6
- package/dist/Kythia.d.ts.map +1 -1
- package/dist/Kythia.js +1 -503
- package/dist/Kythia.js.map +1 -1
- package/dist/KythiaClient.d.ts.map +1 -1
- package/dist/KythiaClient.js +1 -76
- package/dist/KythiaClient.js.map +1 -1
- package/dist/cli/Command.js +1 -16
- package/dist/cli/commands/AboutCommand.d.ts +7 -0
- package/dist/cli/commands/AboutCommand.d.ts.map +1 -0
- package/dist/cli/commands/AboutCommand.js +1 -0
- package/dist/cli/commands/AboutCommand.js.map +1 -0
- package/dist/cli/commands/CacheClearCommand.js +1 -97
- package/dist/cli/commands/DIGenerateCommand.js +1 -168
- package/dist/cli/commands/LangCheckCommand.js +1 -478
- package/dist/cli/commands/LangCheckCommand.js.map +1 -1
- package/dist/cli/commands/LangSyncCommand.js +1 -253
- package/dist/cli/commands/LangTranslateCommand.js +1 -224
- package/dist/cli/commands/MakeMigrationCommand.js +1 -55
- package/dist/cli/commands/MakeModelCommand.js +1 -56
- package/dist/cli/commands/MigrateCommand.js +1 -190
- package/dist/cli/commands/NamespaceCommand.js +1 -92
- package/dist/cli/commands/StructureCommand.js +1 -51
- package/dist/cli/commands/UpversionCommand.js +1 -68
- package/dist/cli/index.js +1 -43
- package/dist/cli/utils/db.js +1 -93
- package/dist/database/KythiaMigrator.js +1 -94
- package/dist/database/KythiaModel.d.ts +4 -3
- package/dist/database/KythiaModel.d.ts.map +1 -1
- package/dist/database/KythiaModel.js +1 -1128
- package/dist/database/KythiaModel.js.map +1 -1
- package/dist/database/KythiaSequelize.js +1 -99
- package/dist/database/KythiaStorage.js +1 -80
- package/dist/database/ModelLoader.js +1 -54
- package/dist/index.js +1 -36
- package/dist/lang/lang/en.json +85 -0
- package/dist/managers/AddonManager.d.ts +2 -2
- package/dist/managers/AddonManager.d.ts.map +1 -1
- package/dist/managers/AddonManager.js +1 -1097
- package/dist/managers/AddonManager.js.map +1 -1
- package/dist/managers/EventManager.js +1 -106
- package/dist/managers/InteractionManager.d.ts +8 -6
- package/dist/managers/InteractionManager.d.ts.map +1 -1
- package/dist/managers/InteractionManager.js +1 -470
- package/dist/managers/InteractionManager.js.map +1 -1
- package/dist/managers/MiddlewareManager.d.ts +4 -3
- package/dist/managers/MiddlewareManager.d.ts.map +1 -1
- package/dist/managers/MiddlewareManager.js +1 -106
- package/dist/managers/MiddlewareManager.js.map +1 -1
- package/dist/managers/ShutdownManager.js +1 -179
- package/dist/managers/TelemetryManager.d.ts +7 -0
- package/dist/managers/TelemetryManager.d.ts.map +1 -1
- package/dist/managers/TelemetryManager.js +1 -201
- package/dist/managers/TelemetryManager.js.map +1 -1
- package/dist/managers/TranslatorManager.d.ts.map +1 -1
- package/dist/managers/TranslatorManager.js +1 -145
- package/dist/managers/TranslatorManager.js.map +1 -1
- package/dist/middlewares/botPermissions.js +1 -28
- package/dist/middlewares/cooldown.js +1 -42
- package/dist/middlewares/isInMainGuild.js +1 -52
- package/dist/middlewares/ownerOnly.js +1 -24
- package/dist/middlewares/userPermissions.js +1 -28
- package/dist/structures/BaseCommand.js +1 -42
- package/dist/types/AddonManager.d.ts +22 -9
- package/dist/types/AddonManager.d.ts.map +1 -1
- package/dist/types/AddonManager.js +1 -3
- package/dist/types/DiscordHelpers.js +1 -3
- package/dist/types/EventManager.d.ts +1 -1
- package/dist/types/EventManager.d.ts.map +1 -1
- package/dist/types/EventManager.js +1 -3
- package/dist/types/InteractionManager.d.ts +8 -6
- package/dist/types/InteractionManager.d.ts.map +1 -1
- package/dist/types/InteractionManager.js +1 -3
- package/dist/types/KythiaClient.d.ts +2 -1
- package/dist/types/KythiaClient.d.ts.map +1 -1
- package/dist/types/KythiaClient.js +1 -3
- package/dist/types/KythiaConfig.d.ts +1 -1
- package/dist/types/KythiaConfig.d.ts.map +1 -1
- package/dist/types/KythiaConfig.js +1 -3
- package/dist/types/KythiaContainer.d.ts +3 -2
- package/dist/types/KythiaContainer.d.ts.map +1 -1
- package/dist/types/KythiaContainer.js +1 -3
- package/dist/types/KythiaLogger.d.ts +1 -1
- package/dist/types/KythiaLogger.d.ts.map +1 -1
- package/dist/types/KythiaLogger.js +1 -3
- package/dist/types/KythiaMigrator.d.ts +2 -1
- package/dist/types/KythiaMigrator.d.ts.map +1 -1
- package/dist/types/KythiaMigrator.js +1 -3
- package/dist/types/KythiaModel.d.ts +6 -5
- package/dist/types/KythiaModel.d.ts.map +1 -1
- package/dist/types/KythiaModel.js +1 -3
- package/dist/types/KythiaOptions.d.ts +9 -6
- package/dist/types/KythiaOptions.d.ts.map +1 -1
- package/dist/types/KythiaOptions.js +1 -3
- package/dist/types/KythiaSequelize.d.ts +2 -1
- package/dist/types/KythiaSequelize.d.ts.map +1 -1
- package/dist/types/KythiaSequelize.js +1 -3
- package/dist/types/KythiaStorage.js +1 -3
- package/dist/types/MiddlewareManager.js +1 -3
- package/dist/types/ModelLoader.d.ts +2 -1
- package/dist/types/ModelLoader.d.ts.map +1 -1
- package/dist/types/ModelLoader.js +1 -3
- package/dist/types/ShutdownManager.js +1 -3
- package/dist/types/TranslatorManager.js +1 -3
- package/dist/types/error.d.ts +7 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/error.js +1 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/index.js +1 -29
- package/dist/utils/InteractionFactory.d.ts.map +1 -1
- package/dist/utils/InteractionFactory.js +1 -334
- package/dist/utils/InteractionFactory.js.map +1 -1
- package/dist/utils/color.js +1 -156
- package/dist/utils/discord.js +1 -19
- package/dist/utils/formatter.js +1 -89
- package/dist/utils/index.js +1 -56
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +1 -202
- package/dist/utils/logger.js.map +1 -1
- package/package.json +5 -2
|
@@ -1,1097 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const discord_js_1 = require("discord.js");
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
-
class AddonManager {
|
|
10
|
-
client;
|
|
11
|
-
container;
|
|
12
|
-
logger;
|
|
13
|
-
buttonHandlers;
|
|
14
|
-
modalHandlers;
|
|
15
|
-
selectMenuHandlers;
|
|
16
|
-
autocompleteHandlers;
|
|
17
|
-
commandCategoryMap;
|
|
18
|
-
categoryToFeatureMap;
|
|
19
|
-
embedDrafts;
|
|
20
|
-
eventHandlers;
|
|
21
|
-
constructor({ client, container, }) {
|
|
22
|
-
this.client = client;
|
|
23
|
-
this.container = container;
|
|
24
|
-
this.logger = this.container.logger;
|
|
25
|
-
this.buttonHandlers = new Map();
|
|
26
|
-
this.modalHandlers = new Map();
|
|
27
|
-
this.selectMenuHandlers = new Map();
|
|
28
|
-
this.autocompleteHandlers = new Map();
|
|
29
|
-
this.commandCategoryMap = new Map();
|
|
30
|
-
this.categoryToFeatureMap = new Map();
|
|
31
|
-
this.embedDrafts = new discord_js_1.Collection();
|
|
32
|
-
this.eventHandlers = new Map();
|
|
33
|
-
}
|
|
34
|
-
registerButtonHandler(customId, handler) {
|
|
35
|
-
try {
|
|
36
|
-
if (this.buttonHandlers.has(customId)) {
|
|
37
|
-
this.logger.warn(`[REGISTRATION] Warning: Button handler for [${customId}] already exists and will be overwritten.`);
|
|
38
|
-
}
|
|
39
|
-
this.buttonHandlers.set(customId, handler);
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
this.logger.error(`Failed to register button handler for [${customId}]:`, error);
|
|
43
|
-
this.container.telemetry?.report('error', `Register Button Handler Failed: [${customId}]`, {
|
|
44
|
-
message: error.message,
|
|
45
|
-
stack: error.stack,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
registerSelectMenuHandler(customIdPrefix, handler) {
|
|
50
|
-
try {
|
|
51
|
-
if (this.selectMenuHandlers.has(customIdPrefix)) {
|
|
52
|
-
this.logger.warn(`[REGISTRATION] Warning: Select menu handler for [${customIdPrefix}] already exists and will be overwritten.`);
|
|
53
|
-
}
|
|
54
|
-
this.selectMenuHandlers.set(customIdPrefix, handler);
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
this.logger.error(`Failed to register select menu handler for [${customIdPrefix}]:`, error);
|
|
58
|
-
this.container.telemetry?.report('error', `Register Select Menu Handler Failed: [${customIdPrefix}]`, {
|
|
59
|
-
message: error.message,
|
|
60
|
-
stack: error.stack,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
registerModalHandler(customIdPrefix, handler) {
|
|
65
|
-
try {
|
|
66
|
-
if (this.modalHandlers.has(customIdPrefix)) {
|
|
67
|
-
this.logger.warn(`[REGISTRATION] Warning: Modal handler for [${customIdPrefix}] already exists and will be overwritten.`);
|
|
68
|
-
}
|
|
69
|
-
this.modalHandlers.set(customIdPrefix, handler);
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
this.logger.error(`Failed to register modal handler for [${customIdPrefix}]:`, error);
|
|
73
|
-
this.container.telemetry?.report('error', `Register Modal Handler Failed: [${customIdPrefix}]`, {
|
|
74
|
-
message: error.message,
|
|
75
|
-
stack: error.stack,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
registerAutocompleteHandler(commandName, handler) {
|
|
80
|
-
try {
|
|
81
|
-
if (this.autocompleteHandlers.has(commandName)) {
|
|
82
|
-
this.logger.warn(`[REGISTRATION] Warning: Autocomplete handler for [${commandName}] already exists.`);
|
|
83
|
-
}
|
|
84
|
-
this.autocompleteHandlers.set(commandName, handler);
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
this.logger.error(`Failed to register autocomplete handler for [${commandName}]:`, error);
|
|
88
|
-
this.container.telemetry?.report('error', `Register Autocomplete Handler Failed: [${commandName}]`, {
|
|
89
|
-
message: error.message,
|
|
90
|
-
stack: error.stack,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
_isBaseCommandClass(module) {
|
|
95
|
-
if (typeof module !== 'function')
|
|
96
|
-
return false;
|
|
97
|
-
if (!module.prototype)
|
|
98
|
-
return false;
|
|
99
|
-
const hasExecute = typeof module.prototype.execute === 'function';
|
|
100
|
-
return hasExecute;
|
|
101
|
-
}
|
|
102
|
-
_instantiateBaseCommand(CommandClass) {
|
|
103
|
-
try {
|
|
104
|
-
return new CommandClass(this.container);
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
this.logger.error(`Failed to instantiate BaseCommand class:`, error);
|
|
108
|
-
this.container.telemetry?.report('error', 'Instantiate BaseCommand Failed', {
|
|
109
|
-
message: error.message,
|
|
110
|
-
stack: error.stack,
|
|
111
|
-
});
|
|
112
|
-
throw error;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
_createBuilderFromData(data, BuilderClass) {
|
|
116
|
-
let builder = new BuilderClass();
|
|
117
|
-
if (typeof data === 'function') {
|
|
118
|
-
data(builder);
|
|
119
|
-
}
|
|
120
|
-
else if (data instanceof BuilderClass) {
|
|
121
|
-
builder = data;
|
|
122
|
-
}
|
|
123
|
-
else if (typeof data === 'object') {
|
|
124
|
-
builder.setName(data.name || 'unnamed');
|
|
125
|
-
builder.setDescription(data.description || 'No description');
|
|
126
|
-
if (BuilderClass === discord_js_1.SlashCommandBuilder) {
|
|
127
|
-
builder.setDescription(data.description || 'No description');
|
|
128
|
-
if (data.permissions) {
|
|
129
|
-
builder.setDefaultMemberPermissions(data.permissions);
|
|
130
|
-
}
|
|
131
|
-
if (data.guildOnly !== undefined) {
|
|
132
|
-
builder.setDMPermission(!data.guildOnly);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
else if (BuilderClass === discord_js_1.ContextMenuCommandBuilder) {
|
|
136
|
-
builder.setType(data.type || discord_js_1.ApplicationCommandType.User);
|
|
137
|
-
if (data.permissions) {
|
|
138
|
-
builder.setDefaultMemberPermissions(data.permissions);
|
|
139
|
-
}
|
|
140
|
-
if (data.guildOnly !== undefined) {
|
|
141
|
-
builder.setDMPermission(!data.guildOnly);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return builder;
|
|
146
|
-
}
|
|
147
|
-
registerCommand(module, filePath, commandNamesSet, commandDataForDeployment, permissionDefaults = {}, options = {}) {
|
|
148
|
-
try {
|
|
149
|
-
if (this._isBaseCommandClass(module)) {
|
|
150
|
-
module = this._instantiateBaseCommand(module);
|
|
151
|
-
}
|
|
152
|
-
const data = module.data || module.slashCommand || module.contextMenuCommand;
|
|
153
|
-
if (!module || !data)
|
|
154
|
-
return null;
|
|
155
|
-
let builderClass;
|
|
156
|
-
if (module.data instanceof discord_js_1.ContextMenuCommandBuilder) {
|
|
157
|
-
builderClass = discord_js_1.ContextMenuCommandBuilder;
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
builderClass = discord_js_1.SlashCommandBuilder;
|
|
161
|
-
}
|
|
162
|
-
const commandBuilder = this._createBuilderFromData(module.data, builderClass);
|
|
163
|
-
const commandName = commandBuilder.name;
|
|
164
|
-
const category = options.folderName || node_path_1.default.basename(node_path_1.default.dirname(filePath));
|
|
165
|
-
const categoryDefaults = permissionDefaults[category] || {};
|
|
166
|
-
const finalCommand = {
|
|
167
|
-
...categoryDefaults,
|
|
168
|
-
...module,
|
|
169
|
-
};
|
|
170
|
-
this.commandCategoryMap.set(commandName, category);
|
|
171
|
-
if (commandNamesSet.has(commandName)) {
|
|
172
|
-
throw new Error(`Duplicate command name detected: "${commandName}" in ${filePath}`);
|
|
173
|
-
}
|
|
174
|
-
commandNamesSet.add(commandName);
|
|
175
|
-
this.client.commands.set(commandName, finalCommand);
|
|
176
|
-
commandDataForDeployment.push(commandBuilder.toJSON());
|
|
177
|
-
if (typeof finalCommand.autocomplete === 'function') {
|
|
178
|
-
this.registerAutocompleteHandler(commandName, finalCommand.autocomplete);
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
181
|
-
type: 'single',
|
|
182
|
-
name: commandName,
|
|
183
|
-
folder: category,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
catch (error) {
|
|
187
|
-
this.logger.error(`Failed to register command from [${filePath}]:`, error);
|
|
188
|
-
this.container.telemetry?.report('error', `Register Command Failed: [${filePath}]`, {
|
|
189
|
-
message: error.message,
|
|
190
|
-
stack: error.stack,
|
|
191
|
-
});
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
async loadAddons(kythiaInstance) {
|
|
196
|
-
this.logger.info('🔌 Loading & Registering Kythia Addons...');
|
|
197
|
-
const commandDataForDeployment = [];
|
|
198
|
-
const addonsDir = node_path_1.default.join(this.container.appRoot, 'addons');
|
|
199
|
-
if (!node_fs_1.default.existsSync(addonsDir))
|
|
200
|
-
return commandDataForDeployment;
|
|
201
|
-
let addonFolders = node_fs_1.default
|
|
202
|
-
.readdirSync(addonsDir, { withFileTypes: true })
|
|
203
|
-
.filter((d) => d.isDirectory() && !d.name.startsWith('_'));
|
|
204
|
-
const coreAddon = addonFolders.find((d) => d.name === 'core');
|
|
205
|
-
const otherAddons = addonFolders.filter((d) => d.name !== 'core');
|
|
206
|
-
if (coreAddon) {
|
|
207
|
-
addonFolders = [coreAddon, ...otherAddons];
|
|
208
|
-
}
|
|
209
|
-
const commandNamesSet = new Set();
|
|
210
|
-
const addonSummaries = [];
|
|
211
|
-
for (const addon of addonFolders) {
|
|
212
|
-
const addonDir = node_path_1.default.join(addonsDir, addon.name);
|
|
213
|
-
let addonVersion = 'v0.0.0-alpha';
|
|
214
|
-
try {
|
|
215
|
-
const addonJsonPath = node_path_1.default.join(addonDir, 'addon.json');
|
|
216
|
-
if (node_fs_1.default.existsSync(addonJsonPath)) {
|
|
217
|
-
let addonJson;
|
|
218
|
-
try {
|
|
219
|
-
const addonJsonRaw = node_fs_1.default.readFileSync(addonJsonPath, 'utf8');
|
|
220
|
-
addonJson = JSON.parse(addonJsonRaw);
|
|
221
|
-
}
|
|
222
|
-
catch (jsonErr) {
|
|
223
|
-
this.logger.warn(`🔴 Failed to parse addon.json for ${addon.name}: ${jsonErr.message}`);
|
|
224
|
-
continue;
|
|
225
|
-
}
|
|
226
|
-
addonVersion = addonJson.version || 'v0.0.0-alpha';
|
|
227
|
-
if (addonJson.active === false) {
|
|
228
|
-
this.logger.info(`🟠 Addon ${addon.name.toUpperCase()} disabled`);
|
|
229
|
-
continue;
|
|
230
|
-
}
|
|
231
|
-
if (addonJson.featureFlag) {
|
|
232
|
-
this.commandCategoryMap.set(addon.name, addon.name);
|
|
233
|
-
this.categoryToFeatureMap.set(addon.name, addonJson.featureFlag);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
this.logger.warn(`🔴 Addon ${addon.name.toUpperCase()} is missing addon.json. Skipping.`);
|
|
238
|
-
continue;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
catch (e) {
|
|
242
|
-
this.logger.warn(`🔴 Error reading addon.json for ${addonDir}: ${e.message}`);
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
try {
|
|
246
|
-
const configAddons = this.container.kythiaConfig?.addons || {};
|
|
247
|
-
if (configAddons.all?.active === false) {
|
|
248
|
-
this.logger.info(`🟠 Addon ${addon.name.toUpperCase()} disabled via kythia config`);
|
|
249
|
-
continue;
|
|
250
|
-
}
|
|
251
|
-
else if (configAddons[addon.name]?.active === false) {
|
|
252
|
-
this.logger.info(`🟠 Addon ${addon.name.toUpperCase()} disabled via kythia config`);
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
catch (e) {
|
|
257
|
-
this.logger.warn(`🔴 Error checking config for addon ${addon.name.toUpperCase()}: ${e.message}`);
|
|
258
|
-
}
|
|
259
|
-
let addonPermissionDefaults = {};
|
|
260
|
-
const permissionsFilePath = node_path_1.default.join(addonDir, 'permissions.js');
|
|
261
|
-
if (node_fs_1.default.existsSync(permissionsFilePath)) {
|
|
262
|
-
try {
|
|
263
|
-
addonPermissionDefaults = require(permissionsFilePath);
|
|
264
|
-
this.logger.info(` └─> Found and loaded permission defaults for addon '${addon.name.toUpperCase()}'`);
|
|
265
|
-
}
|
|
266
|
-
catch (e) {
|
|
267
|
-
this.logger.warn(` └─> Failed to load permissions.js for addon '${addon.name.toUpperCase()}': ${e.message}`);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
let hasLocales = false;
|
|
271
|
-
const addonLangPath = node_path_1.default.join(addonDir, 'lang');
|
|
272
|
-
if (node_fs_1.default.existsSync(addonLangPath)) {
|
|
273
|
-
if (this.container.translator) {
|
|
274
|
-
this.container.translator.loadLocalesFromDir(addonLangPath);
|
|
275
|
-
hasLocales = true;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
const loadedCommandsSummary = [];
|
|
279
|
-
const loadedEventsSummary = [];
|
|
280
|
-
const commandsPath = node_path_1.default.join(addonDir, 'commands');
|
|
281
|
-
if (node_fs_1.default.existsSync(commandsPath)) {
|
|
282
|
-
try {
|
|
283
|
-
const commandsResult = await this._loadCommandsFromPath(commandsPath, addon, addonPermissionDefaults, commandNamesSet, commandDataForDeployment);
|
|
284
|
-
loadedCommandsSummary.push(...commandsResult);
|
|
285
|
-
}
|
|
286
|
-
catch (error) {
|
|
287
|
-
this.logger.error(`❌ Failed to load commands from addon "${addon.name}":`, error);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
const componentSummary = await this._loadAddonComponents(addonDir);
|
|
291
|
-
const registerPath = node_path_1.default.join(addonDir, 'register.js');
|
|
292
|
-
const loadedRegisterSummary = [];
|
|
293
|
-
if (node_fs_1.default.existsSync(registerPath)) {
|
|
294
|
-
try {
|
|
295
|
-
const registration = require(registerPath);
|
|
296
|
-
const regModule = registration.default || registration;
|
|
297
|
-
if (typeof regModule.initialize === 'function') {
|
|
298
|
-
const res = await regModule.initialize(kythiaInstance);
|
|
299
|
-
if (Array.isArray(res))
|
|
300
|
-
loadedRegisterSummary.push(...res);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
catch (error) {
|
|
304
|
-
this.logger.error(`❌ Failed to load register.js for [${addon.name}]:`, error);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
const eventsPath = node_path_1.default.join(addonDir, 'events');
|
|
308
|
-
if (node_fs_1.default.existsSync(eventsPath)) {
|
|
309
|
-
const eventFiles = node_fs_1.default
|
|
310
|
-
.readdirSync(eventsPath)
|
|
311
|
-
.filter((file) => file.endsWith('.js'));
|
|
312
|
-
for (const file of eventFiles) {
|
|
313
|
-
const eventName = node_path_1.default.basename(file, '.js');
|
|
314
|
-
try {
|
|
315
|
-
const eventHandler = require(node_path_1.default.join(eventsPath, file));
|
|
316
|
-
if (typeof eventHandler === 'function') {
|
|
317
|
-
if (!this.eventHandlers.has(eventName)) {
|
|
318
|
-
this.eventHandlers.set(eventName, []);
|
|
319
|
-
}
|
|
320
|
-
this.eventHandlers.get(eventName)?.push(eventHandler);
|
|
321
|
-
loadedEventsSummary.push(eventName);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
catch (error) {
|
|
325
|
-
this.logger.error(`❌ Failed to register event [${eventName}] for [${addon.name}]:`, error);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
addonSummaries.push({
|
|
330
|
-
name: addon.name,
|
|
331
|
-
version: addonVersion,
|
|
332
|
-
commands: loadedCommandsSummary,
|
|
333
|
-
events: loadedEventsSummary,
|
|
334
|
-
register: [...componentSummary, ...loadedRegisterSummary],
|
|
335
|
-
hasLocales: hasLocales,
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
this._logAddonSummary(addonSummaries);
|
|
339
|
-
return commandDataForDeployment;
|
|
340
|
-
}
|
|
341
|
-
async _loadAddonComponents(addonDir) {
|
|
342
|
-
const summary = [];
|
|
343
|
-
const componentTypes = [
|
|
344
|
-
{
|
|
345
|
-
folder: 'buttons',
|
|
346
|
-
register: this.registerButtonHandler.bind(this),
|
|
347
|
-
name: 'Buttons',
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
folder: 'modals',
|
|
351
|
-
register: this.registerModalHandler.bind(this),
|
|
352
|
-
name: 'Modals',
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
folder: 'select_menus',
|
|
356
|
-
register: this.registerSelectMenuHandler.bind(this),
|
|
357
|
-
name: 'Select Menus',
|
|
358
|
-
},
|
|
359
|
-
];
|
|
360
|
-
for (const type of componentTypes) {
|
|
361
|
-
const dirPath = node_path_1.default.join(addonDir, type.folder);
|
|
362
|
-
if (!node_fs_1.default.existsSync(dirPath))
|
|
363
|
-
continue;
|
|
364
|
-
const files = node_fs_1.default
|
|
365
|
-
.readdirSync(dirPath)
|
|
366
|
-
.filter((f) => (f.endsWith('.js') || f.endsWith('.ts')) && !f.endsWith('.d.ts'));
|
|
367
|
-
let count = 0;
|
|
368
|
-
for (const file of files) {
|
|
369
|
-
try {
|
|
370
|
-
const filePath = node_path_1.default.join(dirPath, file);
|
|
371
|
-
let module = require(filePath);
|
|
372
|
-
if (module.default)
|
|
373
|
-
module = module.default;
|
|
374
|
-
if (typeof module.execute !== 'function') {
|
|
375
|
-
this.logger.warn(`⚠️ Skipped component ${file}: Missing 'execute' function.`);
|
|
376
|
-
continue;
|
|
377
|
-
}
|
|
378
|
-
const id = module.customId || node_path_1.default.parse(file).name;
|
|
379
|
-
type.register(id, module.execute);
|
|
380
|
-
count++;
|
|
381
|
-
}
|
|
382
|
-
catch (err) {
|
|
383
|
-
this.logger.error(`❌ Failed to load ${type.name.slice(0, -1)} ${file}:`, err);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
if (count > 0) {
|
|
387
|
-
summary.push(` └─ ✅ Auto-loaded ${count} ${type.name}`);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
return summary;
|
|
391
|
-
}
|
|
392
|
-
async _loadCommandsFromPath(commandsPath, addon, addonPermissionDefaults, commandNamesSet, commandDataForDeployment) {
|
|
393
|
-
const isTopLevelCommandGroup = node_fs_1.default.existsSync(node_path_1.default.join(commandsPath, '_command.js'));
|
|
394
|
-
if (isTopLevelCommandGroup) {
|
|
395
|
-
return await this._loadTopLevelCommandGroup(commandsPath, addon, addonPermissionDefaults, commandNamesSet, commandDataForDeployment);
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
return await this._loadIndividualCommands(commandsPath, addon, addonPermissionDefaults, commandNamesSet, commandDataForDeployment);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
async _loadTopLevelCommandGroup(commandsPath, addon, addonPermissionDefaults, commandNamesSet, commandDataForDeployment) {
|
|
402
|
-
const loadedCommandsSummary = [];
|
|
403
|
-
let commandDef = require(node_path_1.default.join(commandsPath, '_command.js'));
|
|
404
|
-
if (this._isBaseCommandClass(commandDef)) {
|
|
405
|
-
commandDef = this._instantiateBaseCommand(commandDef);
|
|
406
|
-
}
|
|
407
|
-
const category = addon.name;
|
|
408
|
-
const categoryDefaults = addonPermissionDefaults[category] || {};
|
|
409
|
-
if ((commandDef.data || commandDef.slashCommand) &&
|
|
410
|
-
!commandDef.prefixCommand) {
|
|
411
|
-
if (commandDef.disableAutoPrefix !== true) {
|
|
412
|
-
const builder = commandDef.data || commandDef.slashCommand;
|
|
413
|
-
commandDef.prefixCommand = {
|
|
414
|
-
name: builder.name,
|
|
415
|
-
aliases: commandDef.aliases || [],
|
|
416
|
-
description: builder.description,
|
|
417
|
-
autoGenerated: true,
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
commandDef = {
|
|
422
|
-
...categoryDefaults,
|
|
423
|
-
...commandDef,
|
|
424
|
-
};
|
|
425
|
-
const mainData = commandDef.data || commandDef.slashCommand;
|
|
426
|
-
const mainBuilder = this._createBuilderFromData(mainData, discord_js_1.SlashCommandBuilder);
|
|
427
|
-
const mainCommandName = mainBuilder.name;
|
|
428
|
-
if (commandDef.featureFlag) {
|
|
429
|
-
this.commandCategoryMap.set(mainCommandName, addon.name);
|
|
430
|
-
this.categoryToFeatureMap.set(addon.name, commandDef.featureFlag);
|
|
431
|
-
}
|
|
432
|
-
this.commandCategoryMap.set(mainCommandName, addon.name);
|
|
433
|
-
if (commandNamesSet.has(mainCommandName))
|
|
434
|
-
throw new Error(`Duplicate command name: ${mainCommandName}`);
|
|
435
|
-
commandNamesSet.add(mainCommandName);
|
|
436
|
-
this.client.commands.set(mainCommandName, commandDef);
|
|
437
|
-
if (typeof commandDef.autocomplete === 'function') {
|
|
438
|
-
this.registerAutocompleteHandler(mainCommandName, commandDef.autocomplete);
|
|
439
|
-
}
|
|
440
|
-
const loadedSubcommandsSummary = [];
|
|
441
|
-
const contents = node_fs_1.default.readdirSync(commandsPath, { withFileTypes: true });
|
|
442
|
-
for (const item of contents) {
|
|
443
|
-
const itemPath = node_path_1.default.join(commandsPath, item.name);
|
|
444
|
-
if (item.isFile() &&
|
|
445
|
-
item.name.endsWith('.js') &&
|
|
446
|
-
!item.name.startsWith('_')) {
|
|
447
|
-
let subModule = require(itemPath);
|
|
448
|
-
const isSubcommand = subModule.subcommand === true || this._isBaseCommandClass(subModule);
|
|
449
|
-
if (this._isBaseCommandClass(subModule)) {
|
|
450
|
-
subModule = this._instantiateBaseCommand(subModule);
|
|
451
|
-
}
|
|
452
|
-
if (!isSubcommand)
|
|
453
|
-
continue;
|
|
454
|
-
const subData = subModule.data || subModule.slashCommand;
|
|
455
|
-
if (!subData)
|
|
456
|
-
continue;
|
|
457
|
-
const subBuilder = this._createBuilderFromData(subData, discord_js_1.SlashCommandSubcommandBuilder);
|
|
458
|
-
mainBuilder.addSubcommand(subBuilder);
|
|
459
|
-
this.client.commands.set(`${mainCommandName} ${subBuilder.name}`, subModule);
|
|
460
|
-
if (typeof subModule.autocomplete === 'function') {
|
|
461
|
-
this.registerAutocompleteHandler(`${mainCommandName} ${subBuilder.name}`, subModule.autocomplete);
|
|
462
|
-
}
|
|
463
|
-
loadedSubcommandsSummary.push(subBuilder.name);
|
|
464
|
-
}
|
|
465
|
-
else if (item.isDirectory()) {
|
|
466
|
-
const groupDefPath = node_path_1.default.join(itemPath, '_group.js');
|
|
467
|
-
if (!node_fs_1.default.existsSync(groupDefPath)) {
|
|
468
|
-
continue;
|
|
469
|
-
}
|
|
470
|
-
try {
|
|
471
|
-
let groupModule = require(groupDefPath);
|
|
472
|
-
if (this._isBaseCommandClass(groupModule)) {
|
|
473
|
-
groupModule = this._instantiateBaseCommand(groupModule);
|
|
474
|
-
}
|
|
475
|
-
const groupData = groupModule.data || groupModule.slashCommand;
|
|
476
|
-
if (!groupData)
|
|
477
|
-
continue;
|
|
478
|
-
const groupBuilder = this._createBuilderFromData(groupData, discord_js_1.SlashCommandSubcommandGroupBuilder);
|
|
479
|
-
const subcommandsInGroupSummary = [];
|
|
480
|
-
const subCommandFiles = node_fs_1.default
|
|
481
|
-
.readdirSync(itemPath)
|
|
482
|
-
.filter((f) => f.endsWith('.js') && !f.startsWith('_'));
|
|
483
|
-
for (const file of subCommandFiles) {
|
|
484
|
-
const subCommandPath = node_path_1.default.join(itemPath, file);
|
|
485
|
-
let subModule = require(subCommandPath);
|
|
486
|
-
if (this._isBaseCommandClass(subModule)) {
|
|
487
|
-
subModule = this._instantiateBaseCommand(subModule);
|
|
488
|
-
}
|
|
489
|
-
const subData = subModule.data || subModule.slashCommand;
|
|
490
|
-
if (!subData)
|
|
491
|
-
continue;
|
|
492
|
-
const subBuilder = this._createBuilderFromData(subData, discord_js_1.SlashCommandSubcommandBuilder);
|
|
493
|
-
groupBuilder.addSubcommand(subBuilder);
|
|
494
|
-
const commandKey = `${mainCommandName} ${groupBuilder.name} ${subBuilder.name}`;
|
|
495
|
-
this.client.commands.set(commandKey, subModule);
|
|
496
|
-
if (typeof subModule.autocomplete === 'function') {
|
|
497
|
-
this.registerAutocompleteHandler(commandKey, subModule.autocomplete);
|
|
498
|
-
}
|
|
499
|
-
subcommandsInGroupSummary.push(subBuilder.name);
|
|
500
|
-
}
|
|
501
|
-
mainBuilder.addSubcommandGroup(groupBuilder);
|
|
502
|
-
loadedSubcommandsSummary.push({
|
|
503
|
-
group: groupBuilder.name,
|
|
504
|
-
subcommands: subcommandsInGroupSummary,
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
catch (e) {
|
|
508
|
-
this.logger.error(`❌ Failed to load subcommand group from ${itemPath}:`, e);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
if (commandDef.prefixCommand) {
|
|
513
|
-
const pConfig = commandDef.prefixCommand;
|
|
514
|
-
const name = pConfig.name || pConfig.trigger;
|
|
515
|
-
if (name) {
|
|
516
|
-
Object.assign(commandDef, pConfig);
|
|
517
|
-
if (!this.client.commands.has(name)) {
|
|
518
|
-
if (commandNamesSet.has(name)) {
|
|
519
|
-
this.logger.warn(`Duplicate prefix command name detected: "${name}" in ${commandsPath}`);
|
|
520
|
-
}
|
|
521
|
-
else {
|
|
522
|
-
commandNamesSet.add(name);
|
|
523
|
-
this.client.commands.set(name, commandDef);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
else {
|
|
527
|
-
const existing = this.client.commands.get(name);
|
|
528
|
-
if (existing)
|
|
529
|
-
Object.assign(existing, pConfig);
|
|
530
|
-
}
|
|
531
|
-
loadedCommandsSummary.push({
|
|
532
|
-
type: 'single',
|
|
533
|
-
name: name,
|
|
534
|
-
folder: addon.name,
|
|
535
|
-
kind: 'prefix',
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
commandDataForDeployment.push(mainBuilder.toJSON());
|
|
540
|
-
loadedCommandsSummary.push({
|
|
541
|
-
type: 'group',
|
|
542
|
-
name: mainCommandName,
|
|
543
|
-
subcommands: loadedSubcommandsSummary,
|
|
544
|
-
});
|
|
545
|
-
return loadedCommandsSummary;
|
|
546
|
-
}
|
|
547
|
-
async _loadIndividualCommands(commandsPath, addon, addonPermissionDefaults, commandNamesSet, commandDataForDeployment) {
|
|
548
|
-
const loadedCommandsSummary = [];
|
|
549
|
-
const commandItems = node_fs_1.default.readdirSync(commandsPath, { withFileTypes: true });
|
|
550
|
-
for (const item of commandItems) {
|
|
551
|
-
const itemPath = node_path_1.default.join(commandsPath, item.name);
|
|
552
|
-
if (item.isDirectory() &&
|
|
553
|
-
node_fs_1.default.existsSync(node_path_1.default.join(itemPath, '_command.js'))) {
|
|
554
|
-
let commandDef = require(node_path_1.default.join(itemPath, '_command.js'));
|
|
555
|
-
if (this._isBaseCommandClass(commandDef)) {
|
|
556
|
-
commandDef = this._instantiateBaseCommand(commandDef);
|
|
557
|
-
}
|
|
558
|
-
const mainData = commandDef.data || commandDef.slashCommand;
|
|
559
|
-
const mainBuilder = this._createBuilderFromData(mainData, discord_js_1.SlashCommandBuilder);
|
|
560
|
-
const mainCommandName = mainBuilder.name;
|
|
561
|
-
if (commandDef.featureFlag) {
|
|
562
|
-
this.commandCategoryMap.set(mainCommandName, addon.name);
|
|
563
|
-
this.categoryToFeatureMap.set(addon.name, commandDef.featureFlag);
|
|
564
|
-
}
|
|
565
|
-
if (commandNamesSet.has(mainCommandName))
|
|
566
|
-
throw new Error(`Duplicate name: ${mainCommandName}`);
|
|
567
|
-
commandNamesSet.add(mainCommandName);
|
|
568
|
-
this.client.commands.set(mainCommandName, commandDef);
|
|
569
|
-
if (typeof commandDef.autocomplete === 'function') {
|
|
570
|
-
this.registerAutocompleteHandler(mainCommandName, commandDef.autocomplete);
|
|
571
|
-
}
|
|
572
|
-
const subcommandsList = [];
|
|
573
|
-
const groupContents = node_fs_1.default.readdirSync(itemPath, { withFileTypes: true });
|
|
574
|
-
for (const content of groupContents) {
|
|
575
|
-
const contentPath = node_path_1.default.join(itemPath, content.name);
|
|
576
|
-
if (content.isFile() &&
|
|
577
|
-
content.name.endsWith('.js') &&
|
|
578
|
-
!content.name.startsWith('_')) {
|
|
579
|
-
let subModule = require(contentPath);
|
|
580
|
-
if (this._isBaseCommandClass(subModule)) {
|
|
581
|
-
subModule = this._instantiateBaseCommand(subModule);
|
|
582
|
-
}
|
|
583
|
-
const subData = subModule.data || subModule.slashCommand;
|
|
584
|
-
if (!subData)
|
|
585
|
-
continue;
|
|
586
|
-
const subBuilder = this._createBuilderFromData(subData, discord_js_1.SlashCommandSubcommandBuilder);
|
|
587
|
-
mainBuilder.addSubcommand(subBuilder);
|
|
588
|
-
this.client.commands.set(`${mainCommandName} ${subBuilder.name}`, subModule);
|
|
589
|
-
if (typeof subModule.autocomplete === 'function') {
|
|
590
|
-
this.registerAutocompleteHandler(`${mainCommandName} ${subBuilder.name}`, subModule.autocomplete);
|
|
591
|
-
}
|
|
592
|
-
subcommandsList.push(subBuilder.name);
|
|
593
|
-
}
|
|
594
|
-
else if (content.isDirectory() &&
|
|
595
|
-
node_fs_1.default.existsSync(node_path_1.default.join(contentPath, '_group.js'))) {
|
|
596
|
-
let groupDef = require(node_path_1.default.join(contentPath, '_group.js'));
|
|
597
|
-
if (this._isBaseCommandClass(groupDef)) {
|
|
598
|
-
groupDef = this._instantiateBaseCommand(groupDef);
|
|
599
|
-
}
|
|
600
|
-
const groupData = groupDef.data || groupDef.slashCommand;
|
|
601
|
-
const groupBuilder = this._createBuilderFromData(groupData, discord_js_1.SlashCommandSubcommandGroupBuilder);
|
|
602
|
-
const subGroupList = [];
|
|
603
|
-
const subGroupContents = node_fs_1.default.readdirSync(contentPath, {
|
|
604
|
-
withFileTypes: true,
|
|
605
|
-
});
|
|
606
|
-
for (const subSubItem of subGroupContents) {
|
|
607
|
-
if (subSubItem.isFile() &&
|
|
608
|
-
subSubItem.name.endsWith('.js') &&
|
|
609
|
-
!subSubItem.name.startsWith('_')) {
|
|
610
|
-
const subSubPath = node_path_1.default.join(contentPath, subSubItem.name);
|
|
611
|
-
let subSubModule = require(subSubPath);
|
|
612
|
-
if (this._isBaseCommandClass(subSubModule)) {
|
|
613
|
-
subSubModule = this._instantiateBaseCommand(subSubModule);
|
|
614
|
-
}
|
|
615
|
-
const subSubData = subSubModule.data || subSubModule.slashCommand;
|
|
616
|
-
if (!subSubData)
|
|
617
|
-
continue;
|
|
618
|
-
const subSubBuilder = this._createBuilderFromData(subSubData, discord_js_1.SlashCommandSubcommandBuilder);
|
|
619
|
-
groupBuilder.addSubcommand(subSubBuilder);
|
|
620
|
-
this.client.commands.set(`${mainCommandName} ${groupBuilder.name} ${subSubBuilder.name}`, subSubModule);
|
|
621
|
-
if (typeof subSubModule.autocomplete === 'function') {
|
|
622
|
-
this.registerAutocompleteHandler(`${mainCommandName} ${groupBuilder.name} ${subSubBuilder.name}`, subSubModule.autocomplete);
|
|
623
|
-
}
|
|
624
|
-
subGroupList.push(subSubBuilder.name);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
mainBuilder.addSubcommandGroup(groupBuilder);
|
|
628
|
-
subcommandsList.push({
|
|
629
|
-
group: groupBuilder.name,
|
|
630
|
-
subcommands: subGroupList,
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
commandDataForDeployment.push(mainBuilder.toJSON());
|
|
635
|
-
loadedCommandsSummary.push({
|
|
636
|
-
type: 'group',
|
|
637
|
-
name: mainCommandName,
|
|
638
|
-
subcommands: subcommandsList,
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
else if (item.isFile() &&
|
|
642
|
-
item.name.endsWith('.js') &&
|
|
643
|
-
!item.name.startsWith('_')) {
|
|
644
|
-
let commandModule = require(itemPath);
|
|
645
|
-
if (commandModule.default)
|
|
646
|
-
commandModule = commandModule.default;
|
|
647
|
-
let isClass = false;
|
|
648
|
-
if (this._isBaseCommandClass(commandModule)) {
|
|
649
|
-
commandModule = this._instantiateBaseCommand(commandModule);
|
|
650
|
-
isClass = true;
|
|
651
|
-
}
|
|
652
|
-
if (!isClass && commandModule.subcommand)
|
|
653
|
-
continue;
|
|
654
|
-
if (commandModule.slashCommand && !commandModule.prefixCommand) {
|
|
655
|
-
if (commandModule.disableAutoPrefix !== true) {
|
|
656
|
-
commandModule.prefixCommand = {
|
|
657
|
-
name: commandModule.slashCommand.name,
|
|
658
|
-
aliases: commandModule.aliases || [],
|
|
659
|
-
description: commandModule.slashCommand.description,
|
|
660
|
-
autoGenerated: true,
|
|
661
|
-
};
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
let summarySlash = null;
|
|
665
|
-
let summaryContext = null;
|
|
666
|
-
if (commandModule.slashCommand) {
|
|
667
|
-
const builder = commandModule.slashCommand;
|
|
668
|
-
const name = builder.name;
|
|
669
|
-
try {
|
|
670
|
-
const allLocales = this.container.translator?.getLocales();
|
|
671
|
-
const nameLocalizations = {};
|
|
672
|
-
const descriptionLocalizations = {};
|
|
673
|
-
if (typeof allLocales.entries === 'function') {
|
|
674
|
-
for (const [lang, translations] of allLocales.entries()) {
|
|
675
|
-
const nameKey = `command_${name}_name`;
|
|
676
|
-
const descKey = `command_${name}_desc`;
|
|
677
|
-
if (translations[nameKey])
|
|
678
|
-
nameLocalizations[lang] = translations[nameKey];
|
|
679
|
-
if (translations[descKey])
|
|
680
|
-
descriptionLocalizations[lang] = translations[descKey];
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
for (const lang in allLocales) {
|
|
685
|
-
const translations = allLocales[lang];
|
|
686
|
-
const nameKey = `command_${name}_name`;
|
|
687
|
-
const descKey = `command_${name}_desc`;
|
|
688
|
-
if (translations[nameKey])
|
|
689
|
-
nameLocalizations[lang] = translations[nameKey];
|
|
690
|
-
if (translations[descKey])
|
|
691
|
-
descriptionLocalizations[lang] = translations[descKey];
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
if (Object.keys(nameLocalizations).length > 0) {
|
|
695
|
-
builder.setNameLocalizations(nameLocalizations);
|
|
696
|
-
}
|
|
697
|
-
if (Object.keys(descriptionLocalizations).length > 0) {
|
|
698
|
-
builder.setDescriptionLocalizations(descriptionLocalizations);
|
|
699
|
-
}
|
|
700
|
-
this._applySubcommandLocalizations(builder, name, allLocales);
|
|
701
|
-
}
|
|
702
|
-
catch (e) {
|
|
703
|
-
this.logger.warn(`Failed to load localizations for command "${name}": ${e.message}`);
|
|
704
|
-
}
|
|
705
|
-
if (commandNamesSet.has(name)) {
|
|
706
|
-
this.logger.warn(`Duplicate command name detected: "${name}" in ${itemPath}`);
|
|
707
|
-
}
|
|
708
|
-
else {
|
|
709
|
-
commandNamesSet.add(name);
|
|
710
|
-
this.client.commands.set(name, commandModule);
|
|
711
|
-
}
|
|
712
|
-
if (typeof commandModule.autocomplete === 'function') {
|
|
713
|
-
this.registerAutocompleteHandler(name, commandModule.autocomplete);
|
|
714
|
-
}
|
|
715
|
-
commandDataForDeployment.push(builder.toJSON());
|
|
716
|
-
summarySlash = {
|
|
717
|
-
type: 'single',
|
|
718
|
-
name: name,
|
|
719
|
-
folder: addon.name,
|
|
720
|
-
kind: 'slash',
|
|
721
|
-
};
|
|
722
|
-
if (summarySlash)
|
|
723
|
-
loadedCommandsSummary.push(summarySlash);
|
|
724
|
-
this.commandCategoryMap.set(name, addon.name);
|
|
725
|
-
}
|
|
726
|
-
if (commandModule.contextMenuCommand) {
|
|
727
|
-
const builder = commandModule.contextMenuCommand;
|
|
728
|
-
const name = builder.name;
|
|
729
|
-
if (commandNamesSet.has(name) && !commandModule.slashCommand) {
|
|
730
|
-
this.logger.warn(`Duplicate command name detected: "${name}" in ${itemPath}`);
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
if (!commandNamesSet.has(name))
|
|
734
|
-
commandNamesSet.add(name);
|
|
735
|
-
this.client.commands.set(name, commandModule);
|
|
736
|
-
}
|
|
737
|
-
commandDataForDeployment.push(builder.toJSON());
|
|
738
|
-
summaryContext = {
|
|
739
|
-
type: 'single',
|
|
740
|
-
name: name,
|
|
741
|
-
folder: addon.name,
|
|
742
|
-
kind: 'contextMenu',
|
|
743
|
-
};
|
|
744
|
-
if (summaryContext)
|
|
745
|
-
loadedCommandsSummary.push(summaryContext);
|
|
746
|
-
}
|
|
747
|
-
if (!isClass &&
|
|
748
|
-
!commandModule.slashCommand &&
|
|
749
|
-
!commandModule.contextMenuCommand) {
|
|
750
|
-
const summary = this.registerCommand(commandModule, itemPath, commandNamesSet, commandDataForDeployment, addonPermissionDefaults, { folderName: addon.name });
|
|
751
|
-
if (summary)
|
|
752
|
-
loadedCommandsSummary.push(summary);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
else if (item.isDirectory() && !item.name.startsWith('_')) {
|
|
756
|
-
const files = node_fs_1.default
|
|
757
|
-
.readdirSync(itemPath)
|
|
758
|
-
.filter((f) => f.endsWith('.js') && !f.startsWith('_'));
|
|
759
|
-
for (const file of files) {
|
|
760
|
-
const filePath = node_path_1.default.join(itemPath, file);
|
|
761
|
-
let commandModule = require(filePath);
|
|
762
|
-
let isClass = false;
|
|
763
|
-
if (this._isBaseCommandClass(commandModule)) {
|
|
764
|
-
commandModule = this._instantiateBaseCommand(commandModule);
|
|
765
|
-
isClass = true;
|
|
766
|
-
}
|
|
767
|
-
if (!isClass && commandModule.subcommand)
|
|
768
|
-
continue;
|
|
769
|
-
if (commandModule.slashCommand && !commandModule.prefixCommand) {
|
|
770
|
-
if (commandModule.disableAutoPrefix !== true) {
|
|
771
|
-
commandModule.prefixCommand = {
|
|
772
|
-
name: commandModule.slashCommand.name,
|
|
773
|
-
aliases: commandModule.aliases || [],
|
|
774
|
-
description: commandModule.slashCommand.description,
|
|
775
|
-
autoGenerated: true,
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
let summarySlash = null;
|
|
780
|
-
let summaryContext = null;
|
|
781
|
-
if (commandModule.slashCommand) {
|
|
782
|
-
const builder = commandModule.slashCommand;
|
|
783
|
-
const name = builder.name;
|
|
784
|
-
try {
|
|
785
|
-
const allLocales = this.container.translator?.getLocales();
|
|
786
|
-
const nameLocalizations = {};
|
|
787
|
-
const descriptionLocalizations = {};
|
|
788
|
-
if (typeof allLocales.entries === 'function') {
|
|
789
|
-
for (const [lang, translations] of allLocales.entries()) {
|
|
790
|
-
const nameKey = `command_${name}_name`;
|
|
791
|
-
const descKey = `command_${name}_desc`;
|
|
792
|
-
if (translations[nameKey])
|
|
793
|
-
nameLocalizations[lang] = translations[nameKey];
|
|
794
|
-
if (translations[descKey])
|
|
795
|
-
descriptionLocalizations[lang] = translations[descKey];
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
else {
|
|
799
|
-
for (const lang in allLocales) {
|
|
800
|
-
const translations = allLocales[lang];
|
|
801
|
-
const nameKey = `command_${name}_name`;
|
|
802
|
-
const descKey = `command_${name}_desc`;
|
|
803
|
-
if (translations[nameKey])
|
|
804
|
-
nameLocalizations[lang] = translations[nameKey];
|
|
805
|
-
if (translations[descKey])
|
|
806
|
-
descriptionLocalizations[lang] = translations[descKey];
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
if (Object.keys(nameLocalizations).length > 0) {
|
|
810
|
-
builder.setNameLocalizations(nameLocalizations);
|
|
811
|
-
}
|
|
812
|
-
if (Object.keys(descriptionLocalizations).length > 0) {
|
|
813
|
-
builder.setDescriptionLocalizations(descriptionLocalizations);
|
|
814
|
-
}
|
|
815
|
-
this._applySubcommandLocalizations(builder, name, allLocales);
|
|
816
|
-
}
|
|
817
|
-
catch (e) {
|
|
818
|
-
this.logger.warn(`Failed to load localizations for command "${name}": ${e.message}`);
|
|
819
|
-
}
|
|
820
|
-
this.commandCategoryMap.set(name, item.name);
|
|
821
|
-
if (commandNamesSet.has(name)) {
|
|
822
|
-
this.logger.warn(`Duplicate slash command name detected: "${name}" in ${filePath}`);
|
|
823
|
-
}
|
|
824
|
-
else {
|
|
825
|
-
commandNamesSet.add(name);
|
|
826
|
-
this.client.commands.set(name, commandModule);
|
|
827
|
-
commandDataForDeployment.push(builder.toJSON());
|
|
828
|
-
summarySlash = {
|
|
829
|
-
type: 'single',
|
|
830
|
-
name: name,
|
|
831
|
-
folder: item.name,
|
|
832
|
-
kind: 'slash',
|
|
833
|
-
};
|
|
834
|
-
if (summarySlash)
|
|
835
|
-
loadedCommandsSummary.push(summarySlash);
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
if (commandModule.contextMenuCommand) {
|
|
839
|
-
const builder = commandModule.contextMenuCommand;
|
|
840
|
-
const name = builder.name;
|
|
841
|
-
if (!this.client.commands.has(name)) {
|
|
842
|
-
this.client.commands.set(name, commandModule);
|
|
843
|
-
}
|
|
844
|
-
commandDataForDeployment.push(builder.toJSON());
|
|
845
|
-
summaryContext = {
|
|
846
|
-
type: 'single',
|
|
847
|
-
name: name,
|
|
848
|
-
folder: item.name,
|
|
849
|
-
kind: 'contextMenu',
|
|
850
|
-
};
|
|
851
|
-
if (summaryContext)
|
|
852
|
-
loadedCommandsSummary.push(summaryContext);
|
|
853
|
-
}
|
|
854
|
-
if (commandModule.prefixCommand) {
|
|
855
|
-
const pConfig = commandModule.prefixCommand;
|
|
856
|
-
const name = pConfig.name || pConfig.trigger;
|
|
857
|
-
if (name) {
|
|
858
|
-
Object.assign(commandModule, pConfig);
|
|
859
|
-
if (!this.client.commands.has(name)) {
|
|
860
|
-
if (commandNamesSet.has(name)) {
|
|
861
|
-
this.logger.warn(`Duplicate prefix command name detected: "${name}" in ${itemPath}`);
|
|
862
|
-
}
|
|
863
|
-
else {
|
|
864
|
-
commandNamesSet.add(name);
|
|
865
|
-
this.client.commands.set(name, commandModule);
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
else {
|
|
869
|
-
const existing = this.client.commands.get(name);
|
|
870
|
-
if (existing)
|
|
871
|
-
Object.assign(existing, pConfig);
|
|
872
|
-
}
|
|
873
|
-
const summaryPrefix = {
|
|
874
|
-
type: 'single',
|
|
875
|
-
name: name,
|
|
876
|
-
folder: addon.name,
|
|
877
|
-
kind: 'prefix',
|
|
878
|
-
};
|
|
879
|
-
loadedCommandsSummary.push(summaryPrefix);
|
|
880
|
-
this.commandCategoryMap.set(name, addon.name);
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
if (!isClass &&
|
|
884
|
-
!commandModule.slashCommand &&
|
|
885
|
-
!commandModule.contextMenuCommand &&
|
|
886
|
-
!commandModule.prefixCommand) {
|
|
887
|
-
const summary = this.registerCommand(commandModule, filePath, commandNamesSet, commandDataForDeployment, addonPermissionDefaults, { folderName: item.name });
|
|
888
|
-
if (summary)
|
|
889
|
-
loadedCommandsSummary.push(summary);
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
return loadedCommandsSummary;
|
|
895
|
-
}
|
|
896
|
-
_applySubcommandLocalizations(commandBuilder, commandName, allLocales) {
|
|
897
|
-
if (Array.isArray(commandBuilder.options)) {
|
|
898
|
-
for (const group of commandBuilder.options) {
|
|
899
|
-
if (typeof discord_js_1.SlashCommandSubcommandGroupBuilder !== 'undefined' &&
|
|
900
|
-
group instanceof discord_js_1.SlashCommandSubcommandGroupBuilder) {
|
|
901
|
-
const groupName = group.name;
|
|
902
|
-
const groupDescLocalizations = {};
|
|
903
|
-
if (typeof allLocales.entries === 'function') {
|
|
904
|
-
for (const [lang, translations] of allLocales.entries()) {
|
|
905
|
-
const groupDescKey = `command_${commandName}_${groupName}_group_desc`;
|
|
906
|
-
if (translations[groupDescKey])
|
|
907
|
-
groupDescLocalizations[lang] = translations[groupDescKey];
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
else {
|
|
911
|
-
for (const lang in allLocales) {
|
|
912
|
-
const translations = allLocales[lang];
|
|
913
|
-
const groupDescKey = `command_${commandName}_${groupName}_group_desc`;
|
|
914
|
-
if (translations[groupDescKey])
|
|
915
|
-
groupDescLocalizations[lang] = translations[groupDescKey];
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
if (Object.keys(groupDescLocalizations).length > 0 &&
|
|
919
|
-
typeof group.setDescriptionLocalizations === 'function') {
|
|
920
|
-
group.setDescriptionLocalizations(groupDescLocalizations);
|
|
921
|
-
}
|
|
922
|
-
if (Array.isArray(group.options)) {
|
|
923
|
-
for (const sub of group.options) {
|
|
924
|
-
const subName = sub.name;
|
|
925
|
-
const subDescLocalizations = {};
|
|
926
|
-
if (typeof allLocales.entries === 'function') {
|
|
927
|
-
for (const [lang, translations] of allLocales.entries()) {
|
|
928
|
-
const subDescKey = `command_${commandName}_${groupName}_${subName}_desc`;
|
|
929
|
-
if (translations[subDescKey])
|
|
930
|
-
subDescLocalizations[lang] = translations[subDescKey];
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
else {
|
|
934
|
-
for (const lang in allLocales) {
|
|
935
|
-
const translations = allLocales[lang];
|
|
936
|
-
const subDescKey = `command_${commandName}_${groupName}_${subName}_desc`;
|
|
937
|
-
if (translations[subDescKey])
|
|
938
|
-
subDescLocalizations[lang] = translations[subDescKey];
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
if (Object.keys(subDescLocalizations).length > 0 &&
|
|
942
|
-
typeof sub.setDescriptionLocalizations === 'function') {
|
|
943
|
-
sub.setDescriptionLocalizations(subDescLocalizations);
|
|
944
|
-
}
|
|
945
|
-
if (Array.isArray(sub.options)) {
|
|
946
|
-
for (const opt of sub.options) {
|
|
947
|
-
const optName = opt.name;
|
|
948
|
-
const optDescLocalizations = {};
|
|
949
|
-
if (typeof allLocales.entries === 'function') {
|
|
950
|
-
for (const [lang, translations] of allLocales.entries()) {
|
|
951
|
-
const optDescKey = `command_${commandName}_${groupName}_${subName}_option_${optName}`;
|
|
952
|
-
if (translations[optDescKey])
|
|
953
|
-
optDescLocalizations[lang] = translations[optDescKey];
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
else {
|
|
957
|
-
for (const lang in allLocales) {
|
|
958
|
-
const translations = allLocales[lang];
|
|
959
|
-
const optDescKey = `command_${commandName}_${groupName}_${subName}_option_${optName}`;
|
|
960
|
-
if (translations[optDescKey])
|
|
961
|
-
optDescLocalizations[lang] = translations[optDescKey];
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
if (Object.keys(optDescLocalizations).length > 0 &&
|
|
965
|
-
typeof opt.setDescriptionLocalizations === 'function') {
|
|
966
|
-
opt.setDescriptionLocalizations(optDescLocalizations);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
else if (typeof discord_js_1.SlashCommandSubcommandBuilder !== 'undefined' &&
|
|
974
|
-
group instanceof discord_js_1.SlashCommandSubcommandBuilder) {
|
|
975
|
-
const subName = group.name;
|
|
976
|
-
const subDescLocalizations = {};
|
|
977
|
-
if (typeof allLocales.entries === 'function') {
|
|
978
|
-
for (const [lang, translations] of allLocales.entries()) {
|
|
979
|
-
const subDescKey = `command_${commandName}_${subName}_desc`;
|
|
980
|
-
if (translations[subDescKey])
|
|
981
|
-
subDescLocalizations[lang] = translations[subDescKey];
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
else {
|
|
985
|
-
for (const lang in allLocales) {
|
|
986
|
-
const translations = allLocales[lang];
|
|
987
|
-
const subDescKey = `command_${commandName}_${subName}_desc`;
|
|
988
|
-
if (translations[subDescKey])
|
|
989
|
-
subDescLocalizations[lang] = translations[subDescKey];
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
if (Object.keys(subDescLocalizations).length > 0 &&
|
|
993
|
-
typeof group.setDescriptionLocalizations === 'function') {
|
|
994
|
-
group.setDescriptionLocalizations(subDescLocalizations);
|
|
995
|
-
}
|
|
996
|
-
if (Array.isArray(group.options)) {
|
|
997
|
-
for (const opt of group.options) {
|
|
998
|
-
const optName = opt.name;
|
|
999
|
-
const optDescLocalizations = {};
|
|
1000
|
-
if (typeof allLocales.entries === 'function') {
|
|
1001
|
-
for (const [lang, translations] of allLocales.entries()) {
|
|
1002
|
-
const optDescKey = `command_${commandName}_${subName}_option_${optName}`;
|
|
1003
|
-
if (translations[optDescKey])
|
|
1004
|
-
optDescLocalizations[lang] = translations[optDescKey];
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
else {
|
|
1008
|
-
for (const lang in allLocales) {
|
|
1009
|
-
const translations = allLocales[lang];
|
|
1010
|
-
const optDescKey = `command_${commandName}_${subName}_option_${optName}`;
|
|
1011
|
-
if (translations[optDescKey])
|
|
1012
|
-
optDescLocalizations[lang] = translations[optDescKey];
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
if (Object.keys(optDescLocalizations).length > 0 &&
|
|
1016
|
-
typeof opt.setDescriptionLocalizations === 'function') {
|
|
1017
|
-
opt.setDescriptionLocalizations(optDescLocalizations);
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
_logAddonSummary(addonSummaries) {
|
|
1026
|
-
this.logger.info('▬▬▬▬▬▬▬▬▬▬▬▬▬[ Addon(s) Loaded ]▬▬▬▬▬▬▬▬▬▬▬▬▬');
|
|
1027
|
-
for (const addon of addonSummaries) {
|
|
1028
|
-
this.logger.info(`📦 ${addon.name} (v${addon.version})`);
|
|
1029
|
-
this.logger.info(' ⚙️ Command(s)');
|
|
1030
|
-
if (!addon.commands.length) {
|
|
1031
|
-
this.logger.info(' (no commands registered)');
|
|
1032
|
-
}
|
|
1033
|
-
else {
|
|
1034
|
-
for (const cmd of addon.commands) {
|
|
1035
|
-
if (cmd.type === 'group') {
|
|
1036
|
-
this.logger.info(` └─ /${cmd.name}`);
|
|
1037
|
-
for (const sub of cmd.subcommands) {
|
|
1038
|
-
if (typeof sub === 'string') {
|
|
1039
|
-
this.logger.info(` └─ ${sub}`);
|
|
1040
|
-
}
|
|
1041
|
-
else if (typeof sub === 'object' && sub.group) {
|
|
1042
|
-
this.logger.info(` └─ [${sub.group}]`);
|
|
1043
|
-
for (const subsub of sub.subcommands) {
|
|
1044
|
-
this.logger.info(` └─ ${subsub}`);
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
else if (cmd.type === 'single') {
|
|
1050
|
-
let kindLabel = '';
|
|
1051
|
-
if (cmd.kind === 'slash')
|
|
1052
|
-
kindLabel = ' [slash]';
|
|
1053
|
-
else if (cmd.kind === 'contextMenu')
|
|
1054
|
-
kindLabel = ' [contextMenu]';
|
|
1055
|
-
else if (cmd.kind === 'prefix')
|
|
1056
|
-
kindLabel = ' [prefix]';
|
|
1057
|
-
const prefixSymbol = cmd.kind === 'prefix' ? '!' : '/';
|
|
1058
|
-
if (cmd.folder) {
|
|
1059
|
-
this.logger.info(` └─ ${prefixSymbol}${cmd.name} (${cmd.folder})${kindLabel}`);
|
|
1060
|
-
}
|
|
1061
|
-
else {
|
|
1062
|
-
this.logger.info(` └─ ${prefixSymbol}${cmd.name}${kindLabel}`);
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
if (addon.hasLocales) {
|
|
1068
|
-
this.logger.info(' 🌐 Locales: Loaded');
|
|
1069
|
-
}
|
|
1070
|
-
if (addon.register?.length) {
|
|
1071
|
-
this.logger.info(' 🧩 Component(s)');
|
|
1072
|
-
for (const reg of addon.register) {
|
|
1073
|
-
this.logger.info(` ${reg}`);
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
if (addon.events?.length) {
|
|
1077
|
-
this.logger.info(' 📢 Event(s)');
|
|
1078
|
-
for (const ev of addon.events) {
|
|
1079
|
-
this.logger.info(` └─ ${ev}`);
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
getHandlers() {
|
|
1085
|
-
return {
|
|
1086
|
-
buttonHandlers: this.buttonHandlers,
|
|
1087
|
-
modalHandlers: this.modalHandlers,
|
|
1088
|
-
selectMenuHandlers: this.selectMenuHandlers,
|
|
1089
|
-
autocompleteHandlers: this.autocompleteHandlers,
|
|
1090
|
-
commandCategoryMap: this.commandCategoryMap,
|
|
1091
|
-
categoryToFeatureMap: this.categoryToFeatureMap,
|
|
1092
|
-
eventHandlers: this.eventHandlers,
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
exports.default = AddonManager;
|
|
1097
|
-
//# sourceMappingURL=AddonManager.js.map
|
|
1
|
+
'use strict';const a23_0x34c86e=a23_0x5639;(function(_0x29ec7e,_0x1910da){const a23_0x29b521={_0xeefeba:0x1ff,_0x35107d:0x25b,_0x5b6544:0x1fb,_0x1b5438:0x274,_0x41946f:0x23d},_0x5ef0b0=a23_0x5639,_0x1f3175=_0x29ec7e();while(!![]){try{const _0x4c83a8=-parseInt(_0x5ef0b0(0x263))/(-0x1*-0x1d2f+-0x1f0c+0x1de)*(-parseInt(_0x5ef0b0(a23_0x29b521._0xeefeba))/(0x934+0x824*0x4+-0x29c2))+-parseInt(_0x5ef0b0(a23_0x29b521._0x35107d))/(0x3fa+-0x737+0x340)+-parseInt(_0x5ef0b0(a23_0x29b521._0x5b6544))/(0x1a0d+0x7df+0x7c*-0x46)+-parseInt(_0x5ef0b0(a23_0x29b521._0x1b5438))/(-0x1*-0x10f5+-0x228e*-0x1+0xd*-0x3f6)*(parseInt(_0x5ef0b0(0x229))/(-0x270e*-0x1+0x13*-0x1a9+-0x77d))+parseInt(_0x5ef0b0(0x1ca))/(0x4b8+-0x387+-0x12a)+parseInt(_0x5ef0b0(a23_0x29b521._0x41946f))/(-0x1074+-0xca+-0x16*-0xc9)*(parseInt(_0x5ef0b0(0x228))/(-0x7*0x3e5+0x8cf+0x127d))+-parseInt(_0x5ef0b0(0x26b))/(0xe05+0x7*-0x214+0x91);if(_0x4c83a8===_0x1910da)break;else _0x1f3175['push'](_0x1f3175['shift']());}catch(_0x137cc8){_0x1f3175['push'](_0x1f3175['shift']());}}}(a23_0x3520,-0x145*-0x3d3+-0x50701+0xbcbd*0x4));function a23_0x3520(){const _0x43623c=['C2v0rgvMyxvSDe1LBwjLCLbLCM1PC3nPB25Z','BwvZC2fNzq','z3HMvNa','8j+tPIaG','mta4otG0nfzZCwr5sa','y2f0zwDVCNLuB0zLyxr1CMvnyxa','y29UDgv4De1LBNu','CgvYBwLZC2LVBNm','v0joAwu','yMLUza','CMvNAxn0zxjcDxr0B25iyw5KBgvY','icdIMPNVUi8GienVBw1HBMqOCYK','x2DYB3vWx2rLC2m','z2v0sgfUzgXLCNm','BxfuCgy','BMfTzq','rMfPBgvKihrVihjLz2LZDgvYig1VzgfSigHHBMrSzxiGzM9YifS','zw5KC1DPDgG','C2v0tMfTzuXVy2fSAxPHDgLVBNm','CMvNAxn0zxjdB21Tyw5K','yxv0B2nVBxbSzxrLsgfUzgXLCNm','C3rYAw5N','iIbPBIa','yxnZAwDU','BM9KztPWyxrO','Dg9ku09o','zgvMyxvSDa','u2XHC2HdB21Tyw5Ku3vIy29TBwfUzeDYB3vWqNvPBgrLCG','8j+uTcbgywLSzwqGDg8GCgfYC2uGywrKB24UANnVBIbMB3iG','x2nVBw1HBMqUANm','zM9SzgvY','q29UDgv4De1LBNvdB21Tyw5KqNvPBgrLCG','zgvZy3jPChrPB24','Bw9KywXZ','zMvHDhvYzuzSywC','u2XHC2HdB21Tyw5Ku3vIy29TBwfUzej1AwXKzxi','AgLVq1a','A2v5CW','x2DYB3vWlMPZ','sw5ZDgfUDgLHDguGqMfZzunVBw1HBMqGrMfPBgvK','iJOG','CMvNAxn0zxjtzwXLy3rnzw51sgfUzgXLCG','C2v0rgvZy3jPChrPB25mB2nHBgL6yxrPB25Z','x29WDgLVBL8','B3b0Aw9UCW','A2LUza','Dg9vChbLCKnHC2u','CMvNAxn0zxi','icdWN6EPienVBxbVBMvUDcHZkq','AKT2vhO','ywrKu3vIy29TBwfUza','qxbWBgLJyxrPB25dB21Tyw5KvhLWzq','Bg9Nz2vY','nte1nZG0rezArMDx','x2XVywrjBMrPDMLKDwfSq29TBwfUzhm','uMvNAxn0zxiGq29TBwfUzcbgywLSzwq6ifS','4PQG77IpifnRAxbWzwqGy29TCg9Uzw50ia','otGXotH0D2fvsgi','z3jVDxa','ChvZAa','y2XPzw50','ifTWCMvMAxHD','yNv0Dg9UsgfUzgXLCNm','8j+uJcbmB2fKAw5NicyGuMvNAxn0zxjPBMCGs3L0AgLHiefKzg9UCY4UlG','zMLUza','x2nYzwf0zuj1AwXKzxjgCM9Trgf0yq','zxzLBNriyw5KBgvYCW','w1jfr0LtvfjbveLptL0Gv2fYBMLUzZOGqxv0B2nVBxbSzxrLigHHBMrSzxiGzM9YifS','yxv0B2nVBxbSzxrL','icaGicaGicdILjtILiaG','AgfZ','x2XVywrdB21Tyw5KC0zYB21qyxrO','ywrK','lMPZ','x2rLC2m','CMvNAxn0zxjbDxrVy29TCgXLDgviyw5KBgvY','icdWN5oIiev2zw50khmP','xsbHBhjLywr5igv4Axn0CY4','ywn0AxzL','z3vPBgrpBMX5','C2vSzwn0twvUDuHHBMrSzxjZ','C2XPy2u','y29UDgfPBMvY','icaGicdILjtILiaGlW','igrPC2fIBgvKihzPysbRExrOAweGy29UzMLN','w1jfr0LtvfjbveLptL0Gv2fYBMLUzZOGu2vSzwn0ig1LBNuGAgfUzgXLCIbMB3iGwW','C2XHC2HdB21Tyw5K','4P2miezHAwXLzcb0BYbSB2fKia','zNvUy3rPB24','C2v0rgvZy3jPChrPB24','zxHPC3rZu3LUyW','zxjYB3i','vhnjqu0','y29UDgv4De1LBNvdB21Tyw5K','DwHKEwS','uwfQDum','DxrMoa','C2v0','mta1mdyWnKPXwwDrBG','mJyWmJjjuxL5Dwe','rMfPBgvKihrVigLUC3rHBNrPyxrLiejHC2vdB21Tyw5KignSyxnZoG','yNv0Dg9UCW','icdILjtILia+iezVDw5KigfUzcbSB2fKzwqGCgvYBwLZC2LVBIbKzwzHDwX0CYbMB3iGywrKB24GjW','BM9KztPMCW','C2v0vhLWzq','icaGicaGicaGiokuLokuGcbB','Eg1sA20','C3vIy29TBwfUza','zhz6vNm','rhvWBgLJyxrLig5HBwu6ia','x2XVywruB3bmzxzLBenVBw1HBMrhCM91Ca','rMfPBgvKihrVigXVywqGBg9JywXPEMf0Aw9UCYbMB3iGy29TBwfUzcaI','zgLYBMfTzq','zMLSDgvY','ChjLzML4q29TBwfUza','x19LC01VzhvSzq','y29TBwfUzenHDgvNB3j5twfW','tw9KywXZ','AxneAxjLy3rVCNK','oeH1ze5nta','x2LZqMfZzunVBw1HBMrdBgfZCW','C3vIy29TBwfUzhm','Aw5MBW','rhvWBgLJyxrLignVBw1HBMqGBMfTzsbKzxrLy3rLzdOGiG','A3L0AgLHq29UzMLN','y29TBwfUzhm','icaGicdILjtILiaG','DhjPz2DLCG','x25HBwu','DgvSzw1LDhj5','4P2miezHAwXLzcb0BYbSB2fKihjLz2LZDgvYlMPZigzVCIbB','zgLZy29Yzc5QCW','Dw5KzwzPBMvK','B2jQzwn0','ChjLzML4','zxzLBNrZ','Dw5Uyw1Lza','BgfUzW','ywrKB25Z','DhjHBNnSyxrVCG','BgvUz3rO','rhvWBgLJyxrLihbYzwzPEcbJB21Tyw5Kig5HBwuGzgv0zwn0zwq6ici','AxnbCNjHEq','sNbbzui','uK5TAhC','Bg9HzefKzg9UCW','rMfPBgvKihrVihjLz2LZDgvYigj1DhrVBIbOyw5KBgvYigzVCIbB','uMvNAxn0zxiGqxv0B2nVBxbSzxrLieHHBMrSzxiGrMfPBgvKoIbB','qxbwAuy','nta3ndKYvLzRveTR','w1jfr0LtvfjbveLptL0Gv2fYBMLUzZOGqNv0Dg9UigHHBMrSzxiGzM9YifS','ywXPyxnLCW','C3rHy2S','x2XVz0fKzg9Uu3vTBwfYEq','DhLWzq','C2LUz2XL','igLZig1PC3nPBMCGywrKB24UANnVBI4Gu2TPChbPBMCU','nwnUsevgBW','CMvHzgrPCLn5BMm','y29Yzq','D2fYBG','AxngAwXL','y29TBwfUzf8','zw1IzwreCMfMDhm','zw50CMLLCW','mJq4mZaWz09QD1bh','x2LUC3rHBNrPyxrLqMfZzunVBw1HBMq','oIbnAxnZAw5NicDLEgvJDxrLjYbMDw5JDgLVBI4','EMvyuMO','DJaUmc4WlwfSCgHH','C2XHC2G','C3rHCNrZv2L0Aa','x2fWCgX5u3vIy29TBwfUzeXVy2fSAxPHDgLVBNm','u2XHC2HdB21Tyw5KqNvPBgrLCG','mtv0tvLsyuG','Aw5PDgLHBgL6zq','u2nrC1q','vNnes0y','4PAS4PAS4PAS4PAS4PAS4PAS4PAS4PAS4PAS4PAS4PAS4PAS4PASwYbbzgrVBIHZksbmB2fKzwqGxEkwRokwRokwRokwRokwRokwRokwRokwRokwRokwRokwRokwRokwRa','u1HHsgW','CMvWB3j0','ifTZBgfZAf0','wgzQEMm','CgfYC2u','ifTJB250zxH0twvUDv0','z2v0tg9JywXLCW','CMvNAxn0zxiUANm','ChjVDg90ExbL','icdILjtILia+iezHAwXLzcb0BYbSB2fKihbLCM1PC3nPB25ZlMPZigzVCIbHzgrVBIaN','zxHLy3v0zq','AM9PBG','r09ZC3C','C2v0tMfTzq','zgf0yq'];a23_0x3520=function(){return _0x43623c;};return a23_0x3520();}var __importDefault=this&&this['__importDefault']||function(_0x13a829){const a23_0x1c69af={_0x59bf9a:0x239},_0x32097a=a23_0x5639;return _0x13a829&&_0x13a829[_0x32097a(a23_0x1c69af._0x59bf9a)]?_0x13a829:{'default':_0x13a829};};Object['defineProperty'](exports,a23_0x34c86e(0x239),{'value':!![]});const discord_js_1=require(a23_0x34c86e(0x249)),node_path_1=__importDefault(require(a23_0x34c86e(0x1de))),node_fs_1=__importDefault(require(a23_0x34c86e(0x22d)));function a23_0x5639(_0x4a2363,_0x5c864b){_0x4a2363=_0x4a2363-(0x1777*0x1+0x2060+-0x360f);const _0x2e8304=a23_0x3520();let _0x2c672f=_0x2e8304[_0x4a2363];if(a23_0x5639['rCQJJF']===undefined){var _0x200ece=function(_0x17f992){const _0x3a426d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x22ab67='',_0x433216='';for(let _0x31515a=-0x557*0x3+-0x13d5+0x23da,_0x43a87d,_0x4ea947,_0x4f96f9=0xc07*0x1+0x3e1+-0x4*0x3fa;_0x4ea947=_0x17f992['charAt'](_0x4f96f9++);~_0x4ea947&&(_0x43a87d=_0x31515a%(0x1ffa+0x4*0x12f+0x7*-0x53e)?_0x43a87d*(-0xf35+0x4c3*0x6+-0x45f*0x3)+_0x4ea947:_0x4ea947,_0x31515a++%(0xdff+-0x714+-0x24d*0x3))?_0x22ab67+=String['fromCharCode'](-0x2124+-0x24a+0x246d&_0x43a87d>>(-(-0x2*-0x862+-0x1965+0x8a3)*_0x31515a&0x5ea+-0x3a*0x6b+0x125a)):-0x25ac+0x2451+0x15b){_0x4ea947=_0x3a426d['indexOf'](_0x4ea947);}for(let _0x46efb4=-0x8*-0x430+0x1d1f+-0x3e9f*0x1,_0x1eafbb=_0x22ab67['length'];_0x46efb4<_0x1eafbb;_0x46efb4++){_0x433216+='%'+('00'+_0x22ab67['charCodeAt'](_0x46efb4)['toString'](-0x1bd5+-0x1572+0x3157))['slice'](-(-0x1cd0+-0xe8c+-0x5b*-0x7a));}return decodeURIComponent(_0x433216);};a23_0x5639['YhHmOh']=_0x200ece,a23_0x5639['RBdalV']={},a23_0x5639['rCQJJF']=!![];}const _0x5f16e4=_0x2e8304[-0x7f*0x19+0x243+0xa24],_0x36fad4=_0x4a2363+_0x5f16e4,_0x27b373=a23_0x5639['RBdalV'][_0x36fad4];return!_0x27b373?(_0x2c672f=a23_0x5639['YhHmOh'](_0x2c672f),a23_0x5639['RBdalV'][_0x36fad4]=_0x2c672f):_0x2c672f=_0x27b373,_0x2c672f;}class AddonManager{['client'];[a23_0x34c86e(0x218)];['logger'];['buttonHandlers'];['modalHandlers'];[a23_0x34c86e(0x216)];['autocompleteHandlers'];['commandCategoryMap'];['categoryToFeatureMap'];['embedDrafts'];[a23_0x34c86e(0x208)];constructor({client:_0x56372f,container:_0x5f2d16}){const a23_0x9f879e={_0xb6cb64:0x1fa,_0x1d6db0:0x218,_0x8f4fe9:0x1fa,_0xfd8cc7:0x1da,_0x42f554:0x23a,_0x32c7f6:0x1cb,_0x26d675:0x269},_0x53fe02=a23_0x34c86e;this[_0x53fe02(0x202)]=_0x56372f,this[_0x53fe02(0x218)]=_0x5f2d16,this[_0x53fe02(a23_0x9f879e._0xb6cb64)]=this[_0x53fe02(a23_0x9f879e._0x1d6db0)][_0x53fe02(a23_0x9f879e._0x8f4fe9)],this[_0x53fe02(0x204)]=new Map(),this['modalHandlers']=new Map(),this['selectMenuHandlers']=new Map(),this[_0x53fe02(a23_0x9f879e._0xfd8cc7)]=new Map(),this[_0x53fe02(a23_0x9f879e._0x42f554)]=new Map(),this[_0x53fe02(a23_0x9f879e._0x32c7f6)]=new Map(),this[_0x53fe02(a23_0x9f879e._0x26d675)]=new discord_js_1['Collection'](),this['eventHandlers']=new Map();}[a23_0x34c86e(0x1d0)](_0x5ee310,_0x3239cd){const a23_0x2b7bbc={_0x333962:0x1fa,_0x1a85e8:0x25c,_0x376276:0x258,_0x154897:0x27a,_0x3ff8dc:0x25e},_0x366b89=a23_0x34c86e,_0x1db659={'iLjGv':'error'};try{this[_0x366b89(0x204)][_0x366b89(0x20c)](_0x5ee310)&&this[_0x366b89(a23_0x2b7bbc._0x333962)]['warn'](_0x366b89(a23_0x2b7bbc._0x1a85e8)+_0x5ee310+']\x20already\x20exists\x20and\x20will\x20be\x20overwritten.'),this['buttonHandlers'][_0x366b89(0x227)](_0x5ee310,_0x3239cd);}catch(_0x9f396f){this[_0x366b89(a23_0x2b7bbc._0x333962)]['error'](_0x366b89(a23_0x2b7bbc._0x376276)+_0x5ee310+']:',_0x9f396f),this['container']['telemetry']?.[_0x366b89(a23_0x2b7bbc._0x154897)](_0x1db659['iLjGv'],'Register\x20Button\x20Handler\x20Failed:\x20['+_0x5ee310+']',{'message':_0x9f396f[_0x366b89(0x289)],'stack':_0x9f396f[_0x366b89(a23_0x2b7bbc._0x3ff8dc)]});}}[a23_0x34c86e(0x1ef)](_0x1cf3b7,_0x23ed8b){const a23_0x56e2fb={_0x4def5b:0x20c,_0x23eae6:0x1fa,_0xb57ac1:0x216,_0x262300:0x221},_0x3e4a06=a23_0x34c86e;try{this['selectMenuHandlers'][_0x3e4a06(a23_0x56e2fb._0x4def5b)](_0x1cf3b7)&&this[_0x3e4a06(a23_0x56e2fb._0x23eae6)]['warn'](_0x3e4a06(0x21b)+_0x1cf3b7+']\x20already\x20exists\x20and\x20will\x20be\x20overwritten.'),this[_0x3e4a06(a23_0x56e2fb._0xb57ac1)]['set'](_0x1cf3b7,_0x23ed8b);}catch(_0x236b32){this['logger'][_0x3e4a06(a23_0x56e2fb._0x262300)]('Failed\x20to\x20register\x20select\x20menu\x20handler\x20for\x20['+_0x1cf3b7+']:',_0x236b32),this[_0x3e4a06(0x218)][_0x3e4a06(0x247)]?.[_0x3e4a06(0x27a)]('error','Register\x20Select\x20Menu\x20Handler\x20Failed:\x20['+_0x1cf3b7+']',{'message':_0x236b32[_0x3e4a06(0x289)],'stack':_0x236b32[_0x3e4a06(0x25e)]});}}['registerModalHandler'](_0x12760c,_0x3238f5){const a23_0x3a8953={_0x2594c8:0x266,_0x438d80:0x1d6,_0xd8789c:0x247},_0x38b392=a23_0x34c86e;try{this['modalHandlers']['has'](_0x12760c)&&this['logger'][_0x38b392(a23_0x3a8953._0x2594c8)]('[REGISTRATION]\x20Warning:\x20Modal\x20handler\x20for\x20['+_0x12760c+']\x20already\x20exists\x20and\x20will\x20be\x20overwritten.'),this['modalHandlers']['set'](_0x12760c,_0x3238f5);}catch(_0x31727b){this['logger'][_0x38b392(0x221)](_0x38b392(a23_0x3a8953._0x438d80)+_0x12760c+']:',_0x31727b),this['container'][_0x38b392(a23_0x3a8953._0xd8789c)]?.['report'](_0x38b392(0x221),'Register\x20Modal\x20Handler\x20Failed:\x20['+_0x12760c+']',{'message':_0x31727b['message'],'stack':_0x31727b['stack']});}}[a23_0x34c86e(0x211)](_0x5a1188,_0xf342fa){const a23_0x5bad9f={_0x237de3:0x1da,_0x14bfac:0x213,_0x2a8874:0x1fa,_0xf001:0x221,_0x1bab81:0x259,_0x5318de:0x25e},_0x584cb4=a23_0x34c86e;try{this[_0x584cb4(a23_0x5bad9f._0x237de3)][_0x584cb4(0x20c)](_0x5a1188)&&this[_0x584cb4(0x1fa)]['warn'](_0x584cb4(0x209)+_0x5a1188+_0x584cb4(a23_0x5bad9f._0x14bfac)),this[_0x584cb4(0x1da)][_0x584cb4(0x227)](_0x5a1188,_0xf342fa);}catch(_0x1d4f8){this[_0x584cb4(a23_0x5bad9f._0x2a8874)]['error']('Failed\x20to\x20register\x20autocomplete\x20handler\x20for\x20['+_0x5a1188+']:',_0x1d4f8),this['container']['telemetry']?.['report'](_0x584cb4(a23_0x5bad9f._0xf001),_0x584cb4(a23_0x5bad9f._0x1bab81)+_0x5a1188+']',{'message':_0x1d4f8[_0x584cb4(0x289)],'stack':_0x1d4f8[_0x584cb4(a23_0x5bad9f._0x5318de)]});}}['_isBaseCommandClass'](_0x4f9b83){const a23_0x2232e1={_0x4ae009:0x21e,_0x38624a:0x283},_0x5be167=a23_0x34c86e,_0x2ff506={'ygMil':function(_0x55df3a,_0x1f0557){return _0x55df3a!==_0x1f0557;},'NNPLR':'function'};if(_0x2ff506['ygMil'](typeof _0x4f9b83,_0x5be167(a23_0x2232e1._0x4ae009)))return![];if(!_0x4f9b83[_0x5be167(0x281)])return![];const _0x3caee5=typeof _0x4f9b83['prototype'][_0x5be167(a23_0x2232e1._0x38624a)]===_0x2ff506['NNPLR'];return _0x3caee5;}[a23_0x34c86e(0x26c)](_0x15244f){const a23_0x31b129={_0x177c9f:0x1ed,_0x57f567:0x25e},_0x28d309=a23_0x34c86e,_0x4e2a65={'jhJyW':_0x28d309(a23_0x31b129._0x177c9f)};try{return new _0x15244f(this['container']);}catch(_0x1c0f7a){this['logger']['error'](_0x28d309(0x22a),_0x1c0f7a),this[_0x28d309(0x218)]['telemetry']?.[_0x28d309(0x27a)]('error',_0x4e2a65['jhJyW'],{'message':_0x1c0f7a['message'],'stack':_0x1c0f7a[_0x28d309(a23_0x31b129._0x57f567)]});throw _0x1c0f7a;}}['_createBuilderFromData'](_0x5b4395,_0x4ddefc){const a23_0x51bc47={_0x252494:0x25a,_0x4f0c93:0x1ea,_0x4b7fd0:0x24b,_0x4afd3a:0x25a,_0x2c2790:0x273,_0x588796:0x1cd,_0x11e90d:0x1cd,_0x491985:0x215,_0x237155:0x22e,_0x2f5a4c:0x1f9,_0x9aeb5c:0x288},_0x1c2dba=a23_0x34c86e,_0x50b5b8={'ApViF':function(_0x580e36,_0x429d92){return _0x580e36===_0x429d92;},'hioCP':function(_0x5bf2bd,_0x3c362a){return _0x5bf2bd(_0x3c362a);},'QajuC':function(_0x5b86cc,_0x575ce3){return _0x5b86cc instanceof _0x575ce3;},'ICQWJ':_0x1c2dba(0x24e),'sitjH':function(_0x5326ee,_0x37a37e){return _0x5326ee!==_0x37a37e;}};let _0x399dc8=new _0x4ddefc();if(_0x50b5b8[_0x1c2dba(a23_0x51bc47._0x252494)](typeof _0x5b4395,'function'))_0x50b5b8[_0x1c2dba(a23_0x51bc47._0x4f0c93)](_0x5b4395,_0x399dc8);else{if(_0x50b5b8[_0x1c2dba(0x225)](_0x5b4395,_0x4ddefc))_0x399dc8=_0x5b4395;else{if(_0x50b5b8['ApViF'](typeof _0x5b4395,_0x1c2dba(a23_0x51bc47._0x4b7fd0))){_0x399dc8[_0x1c2dba(0x286)](_0x5b4395['name']||_0x50b5b8['ICQWJ']),_0x399dc8['setDescription'](_0x5b4395['description']||'No\x20description');if(_0x50b5b8[_0x1c2dba(a23_0x51bc47._0x4afd3a)](_0x4ddefc,discord_js_1[_0x1c2dba(a23_0x51bc47._0x2c2790)]))_0x399dc8[_0x1c2dba(0x21f)](_0x5b4395['description']||'No\x20description'),_0x5b4395[_0x1c2dba(a23_0x51bc47._0x588796)]&&_0x399dc8[_0x1c2dba(0x288)](_0x5b4395[_0x1c2dba(a23_0x51bc47._0x11e90d)]),_0x5b4395[_0x1c2dba(a23_0x51bc47._0x491985)]!==undefined&&_0x399dc8['setDMPermission'](!_0x5b4395['guildOnly']);else _0x4ddefc===discord_js_1['ContextMenuCommandBuilder']&&(_0x399dc8[_0x1c2dba(a23_0x51bc47._0x237155)](_0x5b4395['type']||discord_js_1[_0x1c2dba(a23_0x51bc47._0x2f5a4c)]['User']),_0x5b4395['permissions']&&_0x399dc8[_0x1c2dba(a23_0x51bc47._0x9aeb5c)](_0x5b4395[_0x1c2dba(a23_0x51bc47._0x588796)]),_0x50b5b8['sitjH'](_0x5b4395[_0x1c2dba(0x215)],undefined)&&_0x399dc8['setDMPermission'](!_0x5b4395['guildOnly']));}}}return _0x399dc8;}[a23_0x34c86e(0x1d9)](_0xbad8a6,_0x28db2d,_0x580b24,_0x187f32,_0x1a3c4d={},_0xfbf185={}){const a23_0x333013={_0x148af3:0x23e,_0x3e77fd:0x1dc,_0x11f9d6:0x21e,_0x4b6216:0x261},_0x23f0a5=a23_0x34c86e;try{this[_0x23f0a5(a23_0x333013._0x148af3)](_0xbad8a6)&&(_0xbad8a6=this['_instantiateBaseCommand'](_0xbad8a6));const _0x38818c=_0xbad8a6['data']||_0xbad8a6['slashCommand']||_0xbad8a6['contextMenuCommand'];if(!_0xbad8a6||!_0x38818c)return null;let _0x4acf13;_0xbad8a6['data']instanceof discord_js_1['ContextMenuCommandBuilder']?_0x4acf13=discord_js_1[_0x23f0a5(0x1e5)]:_0x4acf13=discord_js_1['SlashCommandBuilder'];const _0x1f41ea=this['_createBuilderFromData'](_0xbad8a6['data'],_0x4acf13),_0x7a1d56=_0x1f41ea['name'],_0x4edf6b=_0xfbf185['folderName']||node_path_1[_0x23f0a5(0x1e0)]['basename'](node_path_1['default'][_0x23f0a5(0x236)](_0x28db2d)),_0x38adda=_0x1a3c4d[_0x4edf6b]||{},_0x357484={..._0x38adda,..._0xbad8a6};this[_0x23f0a5(0x23a)][_0x23f0a5(0x227)](_0x7a1d56,_0x4edf6b);if(_0x580b24[_0x23f0a5(0x20c)](_0x7a1d56))throw new Error('Duplicate\x20command\x20name\x20detected:\x20\x22'+_0x7a1d56+_0x23f0a5(a23_0x333013._0x3e77fd)+_0x28db2d);return _0x580b24['add'](_0x7a1d56),this['client']['commands']['set'](_0x7a1d56,_0x357484),_0x187f32['push'](_0x1f41ea['toJSON']()),typeof _0x357484['autocomplete']===_0x23f0a5(a23_0x333013._0x11f9d6)&&this[_0x23f0a5(0x211)](_0x7a1d56,_0x357484['autocomplete']),{'type':_0x23f0a5(a23_0x333013._0x4b6216),'name':_0x7a1d56,'folder':_0x4edf6b};}catch(_0x582b87){return this[_0x23f0a5(0x1fa)][_0x23f0a5(0x221)]('Failed\x20to\x20register\x20command\x20from\x20['+_0x28db2d+']:',_0x582b87),this['container']['telemetry']?.['report']('error',_0x23f0a5(0x1fd)+_0x28db2d+']',{'message':_0x582b87[_0x23f0a5(0x289)],'stack':_0x582b87['stack']}),null;}}async[a23_0x34c86e(0x257)](_0x20d878){const a23_0x589b4c={_0x53ebbf:0x205,_0x287ad6:0x250,_0x45f711:0x1fa,_0x15f4ef:0x240,_0x3253a7:0x1e0,_0x5ca467:0x1d5,_0x5f061e:0x26f,_0x13bcd2:0x220,_0x14fbdc:0x27d,_0x4588d0:0x1e2,_0x44379a:0x240,_0x3e5f87:0x1d5,_0x465092:0x1f4,_0x3b7623:0x1d5,_0xf1ec19:0x266,_0x4d0327:0x289,_0x14ddb1:0x214,_0x582490:0x1f4,_0x45e2cd:0x1d5,_0x34198a:0x251,_0x3b2cee:0x20d,_0x5b7699:0x201,_0x51d8f7:0x221,_0x1b0272:0x284,_0xfc2e1:0x1e0,_0x540cbc:0x275,_0x4dc783:0x26e,_0xbc2026:0x275,_0x492385:0x248,_0x3e040f:0x1e0,_0x4999fe:0x20f,_0x36c30a:0x1e0,_0x46bb15:0x284,_0x1e4faa:0x227,_0x3ce269:0x201},_0x519a9c=a23_0x34c86e,_0x134e09={'VsDKF':_0x519a9c(a23_0x589b4c._0x53ebbf),'TiiUT':_0x519a9c(a23_0x589b4c._0x287ad6),'UCWDu':function(_0x3fa8fb,_0x10bb2e){return _0x3fa8fb===_0x10bb2e;},'zeXRj':_0x519a9c(0x21e),'ErrgE':function(_0x43466e,_0x1f179f){return _0x43466e===_0x1f179f;}};this[_0x519a9c(a23_0x589b4c._0x45f711)][_0x519a9c(a23_0x589b4c._0x15f4ef)](_0x134e09[_0x519a9c(0x277)]);const _0x305826=[],_0x43537a=node_path_1['default'][_0x519a9c(0x284)](this[_0x519a9c(0x218)]['appRoot'],_0x134e09['TiiUT']);if(!node_fs_1[_0x519a9c(0x1e0)]['existsSync'](_0x43537a))return _0x305826;let _0x320105=node_fs_1[_0x519a9c(a23_0x589b4c._0x3253a7)]['readdirSync'](_0x43537a,{'withFileTypes':!![]})['filter'](_0x505271=>_0x505271['isDirectory']()&&!_0x505271['name']['startsWith']('_'));const _0x1b59be=_0x320105[_0x519a9c(0x206)](_0x43baa9=>_0x43baa9['name']==='core'),_0x564c0d=_0x320105['filter'](_0x3de779=>_0x3de779['name']!==_0x519a9c(0x265));_0x1b59be&&(_0x320105=[_0x1b59be,..._0x564c0d]);const _0x55c918=new Set(),_0x606f17=[];for(const _0x4590d3 of _0x320105){const _0x131529=node_path_1['default']['join'](_0x43537a,_0x4590d3[_0x519a9c(a23_0x589b4c._0x5ca467)]);let _0x122a03=_0x519a9c(a23_0x589b4c._0x5f061e);try{const _0x414b73=node_path_1[_0x519a9c(0x1e0)]['join'](_0x131529,'addon.json');if(node_fs_1['default'][_0x519a9c(a23_0x589b4c._0x13bcd2)](_0x414b73)){let _0x2b9bbd;try{const _0x351d0c=node_fs_1[_0x519a9c(a23_0x589b4c._0x3253a7)]['readFileSync'](_0x414b73,_0x519a9c(0x226));_0x2b9bbd=JSON[_0x519a9c(a23_0x589b4c._0x14fbdc)](_0x351d0c);}catch(_0x1d6fc){this[_0x519a9c(0x1fa)]['warn'](_0x519a9c(a23_0x589b4c._0x4588d0)+_0x4590d3[_0x519a9c(0x1d5)]+':\x20'+_0x1d6fc[_0x519a9c(0x289)]);continue;}_0x122a03=_0x2b9bbd['version']||'v0.0.0-alpha';if(_0x2b9bbd['active']===![]){this['logger'][_0x519a9c(a23_0x589b4c._0x44379a)]('🟠\x20Addon\x20'+_0x4590d3[_0x519a9c(a23_0x589b4c._0x3e5f87)][_0x519a9c(a23_0x589b4c._0x465092)]()+'\x20disabled');continue;}_0x2b9bbd['featureFlag']&&(this['commandCategoryMap']['set'](_0x4590d3[_0x519a9c(a23_0x589b4c._0x3b7623)],_0x4590d3['name']),this[_0x519a9c(0x1cb)][_0x519a9c(0x227)](_0x4590d3['name'],_0x2b9bbd[_0x519a9c(0x1e8)]));}else{this[_0x519a9c(0x1fa)][_0x519a9c(a23_0x589b4c._0xf1ec19)]('🔴\x20Addon\x20'+_0x4590d3['name']['toUpperCase']()+_0x519a9c(0x262));continue;}}catch(_0x311f2a){this['logger'][_0x519a9c(0x266)]('🔴\x20Error\x20reading\x20addon.json\x20for\x20'+_0x131529+':\x20'+_0x311f2a[_0x519a9c(a23_0x589b4c._0x4d0327)]);continue;}try{const _0x5bbcb5=this['container'][_0x519a9c(0x242)]?.['addons']||{};if(_0x134e09['UCWDu'](_0x5bbcb5['all']?.[_0x519a9c(0x214)],![])){this['logger'][_0x519a9c(0x240)]('🟠\x20Addon\x20'+_0x4590d3[_0x519a9c(a23_0x589b4c._0x5ca467)]['toUpperCase']()+_0x519a9c(0x21a));continue;}else{if(_0x5bbcb5[_0x4590d3['name']]?.[_0x519a9c(a23_0x589b4c._0x14ddb1)]===![]){this['logger'][_0x519a9c(a23_0x589b4c._0x44379a)]('🟠\x20Addon\x20'+_0x4590d3['name']['toUpperCase']()+_0x519a9c(0x21a));continue;}}}catch(_0x227ef){this['logger'][_0x519a9c(a23_0x589b4c._0xf1ec19)]('🔴\x20Error\x20checking\x20config\x20for\x20addon\x20'+_0x4590d3['name']['toUpperCase']()+':\x20'+_0x227ef['message']);}let _0x10e381={};const _0x6f7170=node_path_1['default']['join'](_0x131529,'permissions.js');if(node_fs_1['default']['existsSync'](_0x6f7170))try{_0x10e381=require(_0x6f7170),this[_0x519a9c(0x1fa)][_0x519a9c(0x240)](_0x519a9c(0x22c)+_0x4590d3['name'][_0x519a9c(a23_0x589b4c._0x582490)]()+'\x27');}catch(_0x458fd2){this['logger']['warn'](_0x519a9c(0x282)+_0x4590d3[_0x519a9c(a23_0x589b4c._0x45e2cd)][_0x519a9c(0x1f4)]()+'\x27:\x20'+_0x458fd2['message']);}let _0x3b5995=![];const _0x27c808=node_path_1[_0x519a9c(0x1e0)]['join'](_0x131529,_0x519a9c(0x24f));node_fs_1['default']['existsSync'](_0x27c808)&&(this[_0x519a9c(0x218)][_0x519a9c(0x251)]&&(this['container'][_0x519a9c(a23_0x589b4c._0x34198a)]['loadLocalesFromDir'](_0x27c808),_0x3b5995=!![]));const _0x5b472f=[],_0x3286e3=[],_0x3b3155=node_path_1['default']['join'](_0x131529,'commands');if(node_fs_1[_0x519a9c(a23_0x589b4c._0x3253a7)][_0x519a9c(a23_0x589b4c._0x13bcd2)](_0x3b3155))try{const _0x21b917=await this[_0x519a9c(a23_0x589b4c._0x3b2cee)](_0x3b3155,_0x4590d3,_0x10e381,_0x55c918,_0x305826);_0x5b472f[_0x519a9c(a23_0x589b4c._0x5b7699)](..._0x21b917);}catch(_0x2dd160){this[_0x519a9c(0x1fa)][_0x519a9c(a23_0x589b4c._0x51d8f7)]('❌\x20Failed\x20to\x20load\x20commands\x20from\x20addon\x20\x22'+_0x4590d3['name']+'\x22:',_0x2dd160);}const _0x3cebd1=await this['_loadAddonComponents'](_0x131529),_0x338f98=node_path_1['default'][_0x519a9c(a23_0x589b4c._0x1b0272)](_0x131529,_0x519a9c(0x280)),_0x3ee164=[];if(node_fs_1[_0x519a9c(a23_0x589b4c._0xfc2e1)][_0x519a9c(0x220)](_0x338f98))try{const _0x34f602=require(_0x338f98),_0x4cbfe8=_0x34f602['default']||_0x34f602;if(typeof _0x4cbfe8[_0x519a9c(a23_0x589b4c._0x540cbc)]===_0x134e09[_0x519a9c(a23_0x589b4c._0x4dc783)]){const _0x13f3d8=await _0x4cbfe8[_0x519a9c(a23_0x589b4c._0xbc2026)](_0x20d878);if(Array[_0x519a9c(0x254)](_0x13f3d8))_0x3ee164[_0x519a9c(0x201)](..._0x13f3d8);}}catch(_0x5c2889){this['logger'][_0x519a9c(0x221)](_0x519a9c(a23_0x589b4c._0x492385)+_0x4590d3['name']+']:',_0x5c2889);}const _0x4b63bf=node_path_1[_0x519a9c(a23_0x589b4c._0x3e040f)][_0x519a9c(0x284)](_0x131529,'events');if(node_fs_1['default']['existsSync'](_0x4b63bf)){const _0x421fe7=node_fs_1[_0x519a9c(0x1e0)]['readdirSync'](_0x4b63bf)[_0x519a9c(0x237)](_0x1af38e=>_0x1af38e['endsWith'](_0x519a9c(0x20f)));for(const _0x3aa53c of _0x421fe7){const _0x1cc4b8=node_path_1['default']['basename'](_0x3aa53c,_0x519a9c(a23_0x589b4c._0x4999fe));try{const _0x198e97=require(node_path_1[_0x519a9c(a23_0x589b4c._0x36c30a)][_0x519a9c(a23_0x589b4c._0x46bb15)](_0x4b63bf,_0x3aa53c));_0x134e09['ErrgE'](typeof _0x198e97,'function')&&(!this[_0x519a9c(0x208)]['has'](_0x1cc4b8)&&this['eventHandlers'][_0x519a9c(a23_0x589b4c._0x1e4faa)](_0x1cc4b8,[]),this['eventHandlers']['get'](_0x1cc4b8)?.['push'](_0x198e97),_0x3286e3[_0x519a9c(a23_0x589b4c._0x3ce269)](_0x1cc4b8));}catch(_0x1fd8a6){this['logger'][_0x519a9c(a23_0x589b4c._0x51d8f7)]('❌\x20Failed\x20to\x20register\x20event\x20['+_0x1cc4b8+']\x20for\x20['+_0x4590d3[_0x519a9c(a23_0x589b4c._0x3b7623)]+']:',_0x1fd8a6);}}}_0x606f17['push']({'name':_0x4590d3['name'],'version':_0x122a03,'commands':_0x5b472f,'events':_0x3286e3,'register':[..._0x3cebd1,..._0x3ee164],'hasLocales':_0x3b5995});}return this['_logAddonSummary'](_0x606f17),_0x305826;}async['_loadAddonComponents'](_0x551cfe){const a23_0x203a3f={_0x1c0a51:0x23b,_0x3b9908:0x21e,_0x240c98:0x1e7,_0x3479e1:0x1cf,_0x54049f:0x27c,_0x3d825e:0x1ef,_0x20411f:0x1e0,_0x4569df:0x1e0,_0x236ee2:0x284,_0x161a13:0x266,_0x390a06:0x26d,_0x2167f3:0x27d,_0x552b21:0x1d5,_0x3f9fbb:0x283,_0x5aeffe:0x1fa,_0x4ab46d:0x217},_0x3ab354=a23_0x34c86e,_0x3db629={'Xfjzc':_0x3ab354(a23_0x203a3f._0x1c0a51),'jKvTz':'select_menus','mqTpf':_0x3ab354(a23_0x203a3f._0x3b9908)},_0x4aac7f=[],_0x5e24b9=[{'folder':_0x3ab354(0x22b),'register':this[_0x3ab354(0x1d0)]['bind'](this),'name':'Buttons'},{'folder':_0x3ab354(a23_0x203a3f._0x240c98),'register':this['registerModalHandler'][_0x3ab354(a23_0x203a3f._0x3479e1)](this),'name':_0x3db629[_0x3ab354(a23_0x203a3f._0x54049f)]},{'folder':_0x3db629[_0x3ab354(0x1f7)],'register':this[_0x3ab354(a23_0x203a3f._0x3d825e)][_0x3ab354(0x1cf)](this),'name':'Select\x20Menus'}];for(const _0x8192d3 of _0x5e24b9){const _0x369981=node_path_1['default']['join'](_0x551cfe,_0x8192d3['folder']);if(!node_fs_1[_0x3ab354(0x1e0)]['existsSync'](_0x369981))continue;const _0x570f8a=node_fs_1[_0x3ab354(a23_0x203a3f._0x20411f)][_0x3ab354(0x264)](_0x369981)[_0x3ab354(0x237)](_0x5ae468=>(_0x5ae468[_0x3ab354(0x1d7)]('.js')||_0x5ae468[_0x3ab354(0x1d7)]('.ts'))&&!_0x5ae468[_0x3ab354(0x1d7)]('.d.ts'));let _0x2bf67b=0x1*0xfb0+0x7*-0x4a2+0x2*0x85f;for(const _0x812dc8 of _0x570f8a){try{const _0xfe72b=node_path_1[_0x3ab354(a23_0x203a3f._0x4569df)][_0x3ab354(a23_0x203a3f._0x236ee2)](_0x369981,_0x812dc8);let _0x59aad7=require(_0xfe72b);if(_0x59aad7['default'])_0x59aad7=_0x59aad7['default'];if(typeof _0x59aad7[_0x3ab354(0x283)]!==_0x3db629[_0x3ab354(0x1d4)]){this['logger'][_0x3ab354(a23_0x203a3f._0x161a13)](_0x3ab354(0x1fe)+_0x812dc8+_0x3ab354(a23_0x203a3f._0x390a06));continue;}const _0x49ab6c=_0x59aad7['customId']||node_path_1[_0x3ab354(0x1e0)][_0x3ab354(a23_0x203a3f._0x2167f3)](_0x812dc8)[_0x3ab354(a23_0x203a3f._0x552b21)];_0x8192d3['register'](_0x49ab6c,_0x59aad7[_0x3ab354(a23_0x203a3f._0x3f9fbb)]),_0x2bf67b++;}catch(_0x2d3e01){this[_0x3ab354(a23_0x203a3f._0x5aeffe)]['error'](_0x3ab354(0x21d)+_0x8192d3['name'][_0x3ab354(a23_0x203a3f._0x4ab46d)](0x6*0x275+0x1ae*-0x10+0xc22*0x1,-(-0x1e92*0x1+0x455*-0x3+0x2b92))+'\x20'+_0x812dc8+':',_0x2d3e01);}}_0x2bf67b>-0xc67+0x14d2+0x5*-0x1af&&_0x4aac7f[_0x3ab354(0x201)]('\x20\x20\x20└─\x20✅\x20Auto-loaded\x20'+_0x2bf67b+'\x20'+_0x8192d3['name']);}return _0x4aac7f;}async['_loadCommandsFromPath'](_0x5df1da,_0x4d8a92,_0x723b4e,_0x2ebb8f,_0x41471f){const a23_0x53e19b={_0x427896:0x220,_0x4ce3ae:0x285,_0x2aa5c4:0x1fc},_0x50aa99=a23_0x34c86e,_0x52c072={'GOssw':'_command.js'},_0x2beacf=node_fs_1[_0x50aa99(0x1e0)][_0x50aa99(a23_0x53e19b._0x427896)](node_path_1['default'][_0x50aa99(0x284)](_0x5df1da,_0x52c072[_0x50aa99(a23_0x53e19b._0x4ce3ae)]));return _0x2beacf?await this['_loadTopLevelCommandGroup'](_0x5df1da,_0x4d8a92,_0x723b4e,_0x2ebb8f,_0x41471f):await this[_0x50aa99(a23_0x53e19b._0x2aa5c4)](_0x5df1da,_0x4d8a92,_0x723b4e,_0x2ebb8f,_0x41471f);}async[a23_0x34c86e(0x234)](_0x24bc5d,_0x2d6be3,_0x142cbd,_0x4f4bd7,_0x49f879){const a23_0x37eb78={_0x1b8aba:0x1e3,_0x2d334e:0x261,_0x4f522c:0x26c,_0x583902:0x1d5,_0x39402f:0x21c,_0x53fc72:0x238,_0x111dec:0x1e6,_0x3e73fb:0x1d5,_0x4c3961:0x1e8,_0x346d53:0x227,_0x340274:0x1d5,_0x5a91ab:0x227,_0x44b0f2:0x20e,_0x4aff13:0x243,_0x21fd89:0x264,_0x10c4e6:0x271,_0x24e87c:0x287,_0x400c9c:0x202,_0x4989d1:0x222,_0x1893b3:0x211,_0x1bf0bc:0x201,_0x4c75a2:0x23c,_0x4e0cd1:0x207,_0x8e6459:0x1e0,_0x56cac8:0x264,_0xd38ef4:0x237,_0x4cccd3:0x23e,_0x5b737c:0x21c,_0xd83846:0x20a,_0x30fa63:0x1d5,_0x26cbf1:0x201,_0x2f748e:0x245,_0x47b777:0x243,_0x5d3426:0x227,_0x4d47a3:0x201,_0xa8f69b:0x1df},_0x46a636=a23_0x34c86e,_0x3c7d05={'dvzVs':_0x46a636(a23_0x37eb78._0x1b8aba),'TsIAM':_0x46a636(0x21e),'WBNie':_0x46a636(0x1ec),'dCCfG':_0x46a636(a23_0x37eb78._0x2d334e)},_0x33c8fb=[];let _0x39d51d=require(node_path_1[_0x46a636(0x1e0)]['join'](_0x24bc5d,_0x3c7d05[_0x46a636(0x232)]));this[_0x46a636(0x23e)](_0x39d51d)&&(_0x39d51d=this[_0x46a636(a23_0x37eb78._0x4f522c)](_0x39d51d));const _0x44ddb6=_0x2d6be3[_0x46a636(a23_0x37eb78._0x583902)],_0x452644=_0x142cbd[_0x44ddb6]||{};if((_0x39d51d['data']||_0x39d51d[_0x46a636(a23_0x37eb78._0x39402f)])&&!_0x39d51d['prefixCommand']){if(_0x39d51d['disableAutoPrefix']!==!![]){const _0x1bd6ef=_0x39d51d['data']||_0x39d51d['slashCommand'];_0x39d51d[_0x46a636(a23_0x37eb78._0x53fc72)]={'name':_0x1bd6ef['name'],'aliases':_0x39d51d['aliases']||[],'description':_0x1bd6ef[_0x46a636(a23_0x37eb78._0x111dec)],'autoGenerated':!![]};}}_0x39d51d={..._0x452644,..._0x39d51d};const _0x31c414=_0x39d51d[_0x46a636(0x287)]||_0x39d51d[_0x46a636(0x21c)],_0x4ac9ab=this['_createBuilderFromData'](_0x31c414,discord_js_1[_0x46a636(0x273)]),_0x3482e2=_0x4ac9ab[_0x46a636(a23_0x37eb78._0x3e73fb)];_0x39d51d[_0x46a636(a23_0x37eb78._0x4c3961)]&&(this['commandCategoryMap'][_0x46a636(a23_0x37eb78._0x346d53)](_0x3482e2,_0x2d6be3[_0x46a636(0x1d5)]),this['categoryToFeatureMap']['set'](_0x2d6be3[_0x46a636(a23_0x37eb78._0x340274)],_0x39d51d[_0x46a636(0x1e8)]));this['commandCategoryMap'][_0x46a636(a23_0x37eb78._0x5a91ab)](_0x3482e2,_0x2d6be3[_0x46a636(0x1d5)]);if(_0x4f4bd7['has'](_0x3482e2))throw new Error('Duplicate\x20command\x20name:\x20'+_0x3482e2);_0x4f4bd7[_0x46a636(a23_0x37eb78._0x44b0f2)](_0x3482e2),this['client'][_0x46a636(a23_0x37eb78._0x4aff13)][_0x46a636(0x227)](_0x3482e2,_0x39d51d);typeof _0x39d51d['autocomplete']==='function'&&this['registerAutocompleteHandler'](_0x3482e2,_0x39d51d[_0x46a636(0x20a)]);const _0x24dc7c=[],_0x2f274a=node_fs_1[_0x46a636(0x1e0)][_0x46a636(a23_0x37eb78._0x21fd89)](_0x24bc5d,{'withFileTypes':!![]});for(const _0x3fcbf2 of _0x2f274a){const _0x57a92f=node_path_1[_0x46a636(0x1e0)][_0x46a636(0x284)](_0x24bc5d,_0x3fcbf2['name']);if(_0x3fcbf2[_0x46a636(0x267)]()&&_0x3fcbf2['name'][_0x46a636(0x1d7)]('.js')&&!_0x3fcbf2['name'][_0x46a636(a23_0x37eb78._0x10c4e6)]('_')){let _0x16df23=require(_0x57a92f);const _0x529a4a=_0x16df23['subcommand']===!![]||this['_isBaseCommandClass'](_0x16df23);this['_isBaseCommandClass'](_0x16df23)&&(_0x16df23=this['_instantiateBaseCommand'](_0x16df23));if(!_0x529a4a)continue;const _0x30ac0f=_0x16df23[_0x46a636(a23_0x37eb78._0x24e87c)]||_0x16df23['slashCommand'];if(!_0x30ac0f)continue;const _0x1c2cfb=this[_0x46a636(0x207)](_0x30ac0f,discord_js_1['SlashCommandSubcommandBuilder']);_0x4ac9ab['addSubcommand'](_0x1c2cfb),this[_0x46a636(a23_0x37eb78._0x400c9c)][_0x46a636(0x243)]['set'](_0x3482e2+'\x20'+_0x1c2cfb[_0x46a636(0x1d5)],_0x16df23),typeof _0x16df23['autocomplete']===_0x3c7d05[_0x46a636(a23_0x37eb78._0x4989d1)]&&this[_0x46a636(a23_0x37eb78._0x1893b3)](_0x3482e2+'\x20'+_0x1c2cfb[_0x46a636(a23_0x37eb78._0x340274)],_0x16df23['autocomplete']),_0x24dc7c[_0x46a636(a23_0x37eb78._0x1bf0bc)](_0x1c2cfb[_0x46a636(0x1d5)]);}else{if(_0x3fcbf2[_0x46a636(a23_0x37eb78._0x4c75a2)]()){const _0x190272=node_path_1['default']['join'](_0x57a92f,_0x3c7d05[_0x46a636(0x1ce)]);if(!node_fs_1[_0x46a636(0x1e0)][_0x46a636(0x220)](_0x190272))continue;try{let _0x409be8=require(_0x190272);this['_isBaseCommandClass'](_0x409be8)&&(_0x409be8=this[_0x46a636(0x26c)](_0x409be8));const _0xf6d203=_0x409be8['data']||_0x409be8[_0x46a636(a23_0x37eb78._0x39402f)];if(!_0xf6d203)continue;const _0x2095dc=this[_0x46a636(a23_0x37eb78._0x4e0cd1)](_0xf6d203,discord_js_1[_0x46a636(0x1e1)]),_0x37fc41=[],_0xdfa252=node_fs_1[_0x46a636(a23_0x37eb78._0x8e6459)][_0x46a636(a23_0x37eb78._0x56cac8)](_0x57a92f)[_0x46a636(a23_0x37eb78._0xd38ef4)](_0x186830=>_0x186830[_0x46a636(0x1d7)](_0x46a636(0x20f))&&!_0x186830['startsWith']('_'));for(const _0x18dc92 of _0xdfa252){const _0x41cc43=node_path_1['default'][_0x46a636(0x284)](_0x57a92f,_0x18dc92);let _0x27dcc9=require(_0x41cc43);this[_0x46a636(a23_0x37eb78._0x4cccd3)](_0x27dcc9)&&(_0x27dcc9=this['_instantiateBaseCommand'](_0x27dcc9));const _0x259199=_0x27dcc9[_0x46a636(0x287)]||_0x27dcc9[_0x46a636(a23_0x37eb78._0x5b737c)];if(!_0x259199)continue;const _0x119f53=this['_createBuilderFromData'](_0x259199,discord_js_1['SlashCommandSubcommandBuilder']);_0x2095dc['addSubcommand'](_0x119f53);const _0x8d65f5=_0x3482e2+'\x20'+_0x2095dc[_0x46a636(0x1d5)]+'\x20'+_0x119f53[_0x46a636(0x1d5)];this['client']['commands']['set'](_0x8d65f5,_0x27dcc9),typeof _0x27dcc9[_0x46a636(0x20a)]==='function'&&this['registerAutocompleteHandler'](_0x8d65f5,_0x27dcc9[_0x46a636(a23_0x37eb78._0xd83846)]),_0x37fc41['push'](_0x119f53[_0x46a636(a23_0x37eb78._0x30fa63)]);}_0x4ac9ab['addSubcommandGroup'](_0x2095dc),_0x24dc7c[_0x46a636(a23_0x37eb78._0x26cbf1)]({'group':_0x2095dc['name'],'subcommands':_0x37fc41});}catch(_0x197c1d){this['logger'][_0x46a636(0x221)]('❌\x20Failed\x20to\x20load\x20subcommand\x20group\x20from\x20'+_0x57a92f+':',_0x197c1d);}}}}if(_0x39d51d['prefixCommand']){const _0x5ed010=_0x39d51d[_0x46a636(a23_0x37eb78._0x53fc72)],_0x27c705=_0x5ed010[_0x46a636(a23_0x37eb78._0x340274)]||_0x5ed010[_0x46a636(a23_0x37eb78._0x2f748e)];if(_0x27c705){Object['assign'](_0x39d51d,_0x5ed010);if(!this[_0x46a636(0x202)]['commands']['has'](_0x27c705))_0x4f4bd7['has'](_0x27c705)?this['logger']['warn']('Duplicate\x20prefix\x20command\x20name\x20detected:\x20\x22'+_0x27c705+_0x46a636(0x1dc)+_0x24bc5d):(_0x4f4bd7[_0x46a636(a23_0x37eb78._0x44b0f2)](_0x27c705),this[_0x46a636(a23_0x37eb78._0x400c9c)][_0x46a636(a23_0x37eb78._0x47b777)][_0x46a636(a23_0x37eb78._0x5d3426)](_0x27c705,_0x39d51d));else{const _0x1b897f=this['client']['commands']['get'](_0x27c705);if(_0x1b897f)Object['assign'](_0x1b897f,_0x5ed010);}_0x33c8fb[_0x46a636(a23_0x37eb78._0x4d47a3)]({'type':_0x3c7d05['dCCfG'],'name':_0x27c705,'folder':_0x2d6be3[_0x46a636(0x1d5)],'kind':'prefix'});}}return _0x49f879['push'](_0x4ac9ab[_0x46a636(a23_0x37eb78._0xa8f69b)]()),_0x33c8fb['push']({'type':_0x46a636(0x200),'name':_0x3482e2,'subcommands':_0x24dc7c}),_0x33c8fb;}async['_loadIndividualCommands'](_0x4ceb36,_0x23b1d3,_0xcfd9e3,_0x58f503,_0x4b3da0){const a23_0x10339d={_0x2afd20:0x264,_0x1ebccd:0x23c,_0x1c539a:0x284,_0x554958:0x1e0,_0x57d1b8:0x23e,_0x426c95:0x233,_0x2ad477:0x1e0,_0x39a789:0x267,_0x26afae:0x1d7,_0x4ffeee:0x20f,_0x2b1dd5:0x1e9,_0xbaf085:0x243,_0x2a8e46:0x1d5,_0x56838e:0x1d5,_0xbcf50a:0x220,_0x15b558:0x276,_0x210bae:0x1e0,_0x1a1390:0x26c,_0x194edc:0x287,_0x2c6541:0x1e1,_0x5894fa:0x1e0,_0x44de0a:0x264,_0x4e3058:0x1d5,_0x579526:0x21c,_0x448cd1:0x207,_0x58e435:0x1f8,_0x57be2a:0x202,_0x2e646a:0x1d5,_0x474509:0x1d5,_0x425116:0x21e,_0x58fea7:0x211,_0x18d97d:0x201,_0x1979af:0x1d5,_0x21afc5:0x21c,_0x274f72:0x25d,_0x4b20c4:0x1e6,_0x46fe58:0x21c,_0x326d3f:0x218,_0x753af6:0x251,_0xf39e01:0x26a,_0x5c81ab:0x26a,_0x2fa680:0x246,_0x336930:0x210,_0x4df062:0x272,_0x22f1a8:0x266,_0x1b35c3:0x235,_0x40c41b:0x223,_0xa357db:0x1dc,_0x545d9c:0x20c,_0x30c1c2:0x1d5,_0x355e3e:0x1d5,_0x1f878a:0x237,_0x33c1a2:0x218,_0x3b692e:0x268,_0x4a0ad3:0x1f0,_0x3765dd:0x1fa,_0x24f7c8:0x1ee,_0x39ef6b:0x23a,_0x5ba9ad:0x20c,_0x1e0a7d:0x201,_0x3de818:0x245,_0x1efdc8:0x20c,_0x1e418c:0x1fa,_0x1929be:0x253,_0x101c20:0x20e},_0xe71989=a23_0x34c86e,_0x42bcba={'ScQsT':_0xe71989(0x1ec),'RNmhw':function(_0x53b59d,_0x45fa3c){return _0x53b59d(_0x45fa3c);},'lKjbm':function(_0x4d918c,_0x39ce60){return _0x4d918c!==_0x39ce60;},'ZqBvU':'contextMenu','gXSvh':function(_0x4e258f,_0x169f03){return _0x4e258f>_0x169f03;},'HhZlB':_0xe71989(0x24c)},_0x1e8af4=[],_0x185360=node_fs_1['default'][_0xe71989(a23_0x10339d._0x2afd20)](_0x4ceb36,{'withFileTypes':!![]});for(const _0x5d91c of _0x185360){const _0x42d6de=node_path_1[_0xe71989(0x1e0)]['join'](_0x4ceb36,_0x5d91c['name']);if(_0x5d91c[_0xe71989(a23_0x10339d._0x1ebccd)]()&&node_fs_1['default']['existsSync'](node_path_1['default'][_0xe71989(a23_0x10339d._0x1c539a)](_0x42d6de,_0xe71989(0x1e3)))){let _0x1b126e=require(node_path_1[_0xe71989(a23_0x10339d._0x554958)]['join'](_0x42d6de,_0xe71989(0x1e3)));this[_0xe71989(a23_0x10339d._0x57d1b8)](_0x1b126e)&&(_0x1b126e=this[_0xe71989(0x26c)](_0x1b126e));const _0x311520=_0x1b126e[_0xe71989(0x287)]||_0x1b126e[_0xe71989(0x21c)],_0x360b2f=this[_0xe71989(0x207)](_0x311520,discord_js_1[_0xe71989(0x273)]),_0x5149be=_0x360b2f['name'];_0x1b126e['featureFlag']&&(this['commandCategoryMap'][_0xe71989(0x227)](_0x5149be,_0x23b1d3['name']),this[_0xe71989(0x1cb)]['set'](_0x23b1d3['name'],_0x1b126e['featureFlag']));if(_0x58f503[_0xe71989(0x20c)](_0x5149be))throw new Error(_0xe71989(a23_0x10339d._0x426c95)+_0x5149be);_0x58f503['add'](_0x5149be),this['client'][_0xe71989(0x243)]['set'](_0x5149be,_0x1b126e);typeof _0x1b126e[_0xe71989(0x20a)]===_0xe71989(0x21e)&&this['registerAutocompleteHandler'](_0x5149be,_0x1b126e[_0xe71989(0x20a)]);const _0x4701a1=[],_0x1098b8=node_fs_1['default']['readdirSync'](_0x42d6de,{'withFileTypes':!![]});for(const _0x3f3c74 of _0x1098b8){const _0x3f49d6=node_path_1[_0xe71989(a23_0x10339d._0x2ad477)]['join'](_0x42d6de,_0x3f3c74['name']);if(_0x3f3c74[_0xe71989(a23_0x10339d._0x39a789)]()&&_0x3f3c74[_0xe71989(0x1d5)][_0xe71989(a23_0x10339d._0x26afae)](_0xe71989(a23_0x10339d._0x4ffeee))&&!_0x3f3c74['name']['startsWith']('_')){let _0x2072ed=require(_0x3f49d6);this['_isBaseCommandClass'](_0x2072ed)&&(_0x2072ed=this['_instantiateBaseCommand'](_0x2072ed));const _0x125340=_0x2072ed['data']||_0x2072ed[_0xe71989(0x21c)];if(!_0x125340)continue;const _0x48e487=this[_0xe71989(0x207)](_0x125340,discord_js_1[_0xe71989(a23_0x10339d._0x2b1dd5)]);_0x360b2f[_0xe71989(0x1f8)](_0x48e487),this['client'][_0xe71989(a23_0x10339d._0xbaf085)]['set'](_0x5149be+'\x20'+_0x48e487[_0xe71989(a23_0x10339d._0x2a8e46)],_0x2072ed),typeof _0x2072ed[_0xe71989(0x20a)]==='function'&&this[_0xe71989(0x211)](_0x5149be+'\x20'+_0x48e487[_0xe71989(0x1d5)],_0x2072ed[_0xe71989(0x20a)]),_0x4701a1['push'](_0x48e487[_0xe71989(a23_0x10339d._0x56838e)]);}else{if(_0x3f3c74[_0xe71989(0x23c)]()&&node_fs_1['default'][_0xe71989(a23_0x10339d._0xbcf50a)](node_path_1[_0xe71989(0x1e0)][_0xe71989(0x284)](_0x3f49d6,_0x42bcba[_0xe71989(a23_0x10339d._0x15b558)]))){let _0x92e44e=_0x42bcba[_0xe71989(0x256)](require,node_path_1[_0xe71989(a23_0x10339d._0x210bae)]['join'](_0x3f49d6,_0xe71989(0x1ec)));this[_0xe71989(a23_0x10339d._0x57d1b8)](_0x92e44e)&&(_0x92e44e=this[_0xe71989(a23_0x10339d._0x1a1390)](_0x92e44e));const _0x310815=_0x92e44e[_0xe71989(a23_0x10339d._0x194edc)]||_0x92e44e['slashCommand'],_0x1e5fbb=this['_createBuilderFromData'](_0x310815,discord_js_1[_0xe71989(a23_0x10339d._0x2c6541)]),_0xd7fbb7=[],_0x38f095=node_fs_1[_0xe71989(a23_0x10339d._0x5894fa)][_0xe71989(a23_0x10339d._0x44de0a)](_0x3f49d6,{'withFileTypes':!![]});for(const _0x1659a8 of _0x38f095){if(_0x1659a8['isFile']()&&_0x1659a8[_0xe71989(a23_0x10339d._0x4e3058)]['endsWith']('.js')&&!_0x1659a8[_0xe71989(a23_0x10339d._0x2a8e46)][_0xe71989(0x271)]('_')){const _0x1ba29=node_path_1[_0xe71989(0x1e0)]['join'](_0x3f49d6,_0x1659a8['name']);let _0x3f0687=require(_0x1ba29);this['_isBaseCommandClass'](_0x3f0687)&&(_0x3f0687=this['_instantiateBaseCommand'](_0x3f0687));const _0x3c8263=_0x3f0687['data']||_0x3f0687[_0xe71989(a23_0x10339d._0x579526)];if(!_0x3c8263)continue;const _0x3f6786=this[_0xe71989(a23_0x10339d._0x448cd1)](_0x3c8263,discord_js_1['SlashCommandSubcommandBuilder']);_0x1e5fbb[_0xe71989(a23_0x10339d._0x58e435)](_0x3f6786),this[_0xe71989(a23_0x10339d._0x57be2a)][_0xe71989(0x243)]['set'](_0x5149be+'\x20'+_0x1e5fbb[_0xe71989(a23_0x10339d._0x2e646a)]+'\x20'+_0x3f6786[_0xe71989(a23_0x10339d._0x474509)],_0x3f0687),typeof _0x3f0687['autocomplete']===_0xe71989(a23_0x10339d._0x425116)&&this[_0xe71989(a23_0x10339d._0x58fea7)](_0x5149be+'\x20'+_0x1e5fbb['name']+'\x20'+_0x3f6786['name'],_0x3f0687['autocomplete']),_0xd7fbb7[_0xe71989(a23_0x10339d._0x18d97d)](_0x3f6786[_0xe71989(a23_0x10339d._0x56838e)]);}}_0x360b2f['addSubcommandGroup'](_0x1e5fbb),_0x4701a1[_0xe71989(0x201)]({'group':_0x1e5fbb[_0xe71989(0x1d5)],'subcommands':_0xd7fbb7});}}}_0x4b3da0['push'](_0x360b2f[_0xe71989(0x1df)]()),_0x1e8af4[_0xe71989(0x201)]({'type':'group','name':_0x5149be,'subcommands':_0x4701a1});}else{if(_0x5d91c['isFile']()&&_0x5d91c['name']['endsWith']('.js')&&!_0x5d91c[_0xe71989(a23_0x10339d._0x1979af)]['startsWith']('_')){let _0x5a2f88=require(_0x42d6de);if(_0x5a2f88['default'])_0x5a2f88=_0x5a2f88['default'];let _0x35a440=![];this[_0xe71989(0x23e)](_0x5a2f88)&&(_0x5a2f88=this[_0xe71989(0x26c)](_0x5a2f88),_0x35a440=!![]);if(!_0x35a440&&_0x5a2f88[_0xe71989(0x231)])continue;_0x5a2f88[_0xe71989(a23_0x10339d._0x21afc5)]&&!_0x5a2f88[_0xe71989(0x238)]&&(_0x42bcba['lKjbm'](_0x5a2f88['disableAutoPrefix'],!![])&&(_0x5a2f88[_0xe71989(0x238)]={'name':_0x5a2f88['slashCommand']['name'],'aliases':_0x5a2f88[_0xe71989(a23_0x10339d._0x274f72)]||[],'description':_0x5a2f88[_0xe71989(a23_0x10339d._0x21afc5)][_0xe71989(a23_0x10339d._0x4b20c4)],'autoGenerated':!![]}));let _0x46369f=null,_0x27079e=null;if(_0x5a2f88[_0xe71989(a23_0x10339d._0x46fe58)]){const _0x58095e=_0x5a2f88['slashCommand'],_0x7431c5=_0x58095e['name'];try{const _0x5ce619=this[_0xe71989(a23_0x10339d._0x326d3f)][_0xe71989(a23_0x10339d._0x753af6)]?.[_0xe71989(0x27f)](),_0x1ae72e={},_0x4bbd31={};if(typeof _0x5ce619[_0xe71989(a23_0x10339d._0xf39e01)]==='function')for(const [_0x122bab,_0x5d2fd2]of _0x5ce619[_0xe71989(a23_0x10339d._0x5c81ab)]()){const _0x312584=_0xe71989(0x268)+_0x7431c5+_0xe71989(0x246),_0x51aaf9='command_'+_0x7431c5+'_desc';if(_0x5d2fd2[_0x312584])_0x1ae72e[_0x122bab]=_0x5d2fd2[_0x312584];if(_0x5d2fd2[_0x51aaf9])_0x4bbd31[_0x122bab]=_0x5d2fd2[_0x51aaf9];}else for(const _0x3aa4ae in _0x5ce619){const _0xbc65c9=_0x5ce619[_0x3aa4ae],_0x54edc2='command_'+_0x7431c5+_0xe71989(a23_0x10339d._0x2fa680),_0x5122e1='command_'+_0x7431c5+_0xe71989(a23_0x10339d._0x336930);if(_0xbc65c9[_0x54edc2])_0x1ae72e[_0x3aa4ae]=_0xbc65c9[_0x54edc2];if(_0xbc65c9[_0x5122e1])_0x4bbd31[_0x3aa4ae]=_0xbc65c9[_0x5122e1];}Object[_0xe71989(0x1eb)](_0x1ae72e)['length']>0xc29*-0x1+0x17a8+-0xb7f&&_0x58095e[_0xe71989(0x1d8)](_0x1ae72e),Object[_0xe71989(0x1eb)](_0x4bbd31)[_0xe71989(0x252)]>-0xeb2+-0x1a95+-0x2947*-0x1&&_0x58095e[_0xe71989(0x1f0)](_0x4bbd31),this[_0xe71989(a23_0x10339d._0x4df062)](_0x58095e,_0x7431c5,_0x5ce619);}catch(_0xe0315d){this[_0xe71989(0x1fa)][_0xe71989(a23_0x10339d._0x22f1a8)](_0xe71989(a23_0x10339d._0x1b35c3)+_0x7431c5+_0xe71989(0x1ee)+_0xe0315d[_0xe71989(0x289)]);}_0x58f503[_0xe71989(0x20c)](_0x7431c5)?this['logger'][_0xe71989(a23_0x10339d._0x22f1a8)](_0xe71989(0x241)+_0x7431c5+'\x22\x20in\x20'+_0x42d6de):(_0x58f503['add'](_0x7431c5),this[_0xe71989(a23_0x10339d._0x57be2a)][_0xe71989(0x243)]['set'](_0x7431c5,_0x5a2f88));typeof _0x5a2f88[_0xe71989(0x20a)]==='function'&&this['registerAutocompleteHandler'](_0x7431c5,_0x5a2f88['autocomplete']);_0x4b3da0['push'](_0x58095e['toJSON']()),_0x46369f={'type':'single','name':_0x7431c5,'folder':_0x23b1d3['name'],'kind':'slash'};if(_0x46369f)_0x1e8af4[_0xe71989(0x201)](_0x46369f);this['commandCategoryMap']['set'](_0x7431c5,_0x23b1d3[_0xe71989(0x1d5)]);}if(_0x5a2f88[_0xe71989(a23_0x10339d._0x40c41b)]){const _0x2e8d9a=_0x5a2f88[_0xe71989(0x223)],_0xcee7df=_0x2e8d9a[_0xe71989(0x1d5)];if(_0x58f503['has'](_0xcee7df)&&!_0x5a2f88['slashCommand'])this['logger']['warn']('Duplicate\x20command\x20name\x20detected:\x20\x22'+_0xcee7df+_0xe71989(a23_0x10339d._0xa357db)+_0x42d6de);else{if(!_0x58f503[_0xe71989(a23_0x10339d._0x545d9c)](_0xcee7df))_0x58f503[_0xe71989(0x20e)](_0xcee7df);this[_0xe71989(a23_0x10339d._0x57be2a)][_0xe71989(0x243)]['set'](_0xcee7df,_0x5a2f88);}_0x4b3da0[_0xe71989(a23_0x10339d._0x18d97d)](_0x2e8d9a['toJSON']()),_0x27079e={'type':'single','name':_0xcee7df,'folder':_0x23b1d3[_0xe71989(a23_0x10339d._0x30c1c2)],'kind':_0x42bcba['ZqBvU']};if(_0x27079e)_0x1e8af4['push'](_0x27079e);}if(!_0x35a440&&!_0x5a2f88['slashCommand']&&!_0x5a2f88['contextMenuCommand']){const _0x3211a1=this['registerCommand'](_0x5a2f88,_0x42d6de,_0x58f503,_0x4b3da0,_0xcfd9e3,{'folderName':_0x23b1d3['name']});if(_0x3211a1)_0x1e8af4[_0xe71989(0x201)](_0x3211a1);}}else{if(_0x5d91c[_0xe71989(0x23c)]()&&!_0x5d91c[_0xe71989(a23_0x10339d._0x355e3e)]['startsWith']('_')){const _0x41b725=node_fs_1[_0xe71989(0x1e0)][_0xe71989(a23_0x10339d._0x44de0a)](_0x42d6de)[_0xe71989(a23_0x10339d._0x1f878a)](_0x6fa6a7=>_0x6fa6a7['endsWith'](_0xe71989(0x20f))&&!_0x6fa6a7[_0xe71989(0x271)]('_'));for(const _0x5220d6 of _0x41b725){const _0x773ce3=node_path_1['default']['join'](_0x42d6de,_0x5220d6);let _0x170616=require(_0x773ce3),_0x56d602=![];this['_isBaseCommandClass'](_0x170616)&&(_0x170616=this[_0xe71989(a23_0x10339d._0x1a1390)](_0x170616),_0x56d602=!![]);if(!_0x56d602&&_0x170616['subcommand'])continue;_0x170616['slashCommand']&&!_0x170616['prefixCommand']&&(_0x170616['disableAutoPrefix']!==!![]&&(_0x170616['prefixCommand']={'name':_0x170616['slashCommand'][_0xe71989(a23_0x10339d._0x1979af)],'aliases':_0x170616['aliases']||[],'description':_0x170616[_0xe71989(0x21c)][_0xe71989(0x1e6)],'autoGenerated':!![]}));let _0x5caa4f=null,_0x10ca8a=null;if(_0x170616[_0xe71989(a23_0x10339d._0x21afc5)]){const _0x489a30=_0x170616['slashCommand'],_0x50d7f0=_0x489a30[_0xe71989(0x1d5)];try{const _0x3ea0c4=this[_0xe71989(a23_0x10339d._0x33c1a2)]['translator']?.['getLocales'](),_0x514d84={},_0x1fbd4c={};if(typeof _0x3ea0c4['entries']==='function')for(const [_0x1c46e4,_0x395bfb]of _0x3ea0c4[_0xe71989(0x26a)]()){const _0x3ec783=_0xe71989(a23_0x10339d._0x3b692e)+_0x50d7f0+'_name',_0xe7e864='command_'+_0x50d7f0+_0xe71989(0x210);if(_0x395bfb[_0x3ec783])_0x514d84[_0x1c46e4]=_0x395bfb[_0x3ec783];if(_0x395bfb[_0xe7e864])_0x1fbd4c[_0x1c46e4]=_0x395bfb[_0xe7e864];}else for(const _0x35ce8b in _0x3ea0c4){const _0x98fdf6=_0x3ea0c4[_0x35ce8b],_0x295297='command_'+_0x50d7f0+_0xe71989(a23_0x10339d._0x2fa680),_0x44649d=_0xe71989(0x268)+_0x50d7f0+_0xe71989(0x210);if(_0x98fdf6[_0x295297])_0x514d84[_0x35ce8b]=_0x98fdf6[_0x295297];if(_0x98fdf6[_0x44649d])_0x1fbd4c[_0x35ce8b]=_0x98fdf6[_0x44649d];}Object['keys'](_0x514d84)[_0xe71989(0x252)]>-0x1a82+-0x161b*-0x1+0x467&&_0x489a30['setNameLocalizations'](_0x514d84),_0x42bcba['gXSvh'](Object[_0xe71989(0x1eb)](_0x1fbd4c)[_0xe71989(0x252)],-0xd41+0x1c53+-0xf12)&&_0x489a30[_0xe71989(a23_0x10339d._0x4a0ad3)](_0x1fbd4c),this[_0xe71989(a23_0x10339d._0x4df062)](_0x489a30,_0x50d7f0,_0x3ea0c4);}catch(_0x575a09){this[_0xe71989(a23_0x10339d._0x3765dd)]['warn']('Failed\x20to\x20load\x20localizations\x20for\x20command\x20\x22'+_0x50d7f0+_0xe71989(a23_0x10339d._0x24f7c8)+_0x575a09['message']);}this[_0xe71989(a23_0x10339d._0x39ef6b)][_0xe71989(0x227)](_0x50d7f0,_0x5d91c[_0xe71989(a23_0x10339d._0x4e3058)]);if(_0x58f503[_0xe71989(a23_0x10339d._0x5ba9ad)](_0x50d7f0))this['logger'][_0xe71989(0x266)]('Duplicate\x20slash\x20command\x20name\x20detected:\x20\x22'+_0x50d7f0+_0xe71989(0x1dc)+_0x773ce3);else{_0x58f503['add'](_0x50d7f0),this[_0xe71989(0x202)][_0xe71989(0x243)]['set'](_0x50d7f0,_0x170616),_0x4b3da0[_0xe71989(a23_0x10339d._0x1e0a7d)](_0x489a30['toJSON']()),_0x5caa4f={'type':_0xe71989(0x261),'name':_0x50d7f0,'folder':_0x5d91c['name'],'kind':_0xe71989(0x270)};if(_0x5caa4f)_0x1e8af4['push'](_0x5caa4f);}}if(_0x170616[_0xe71989(0x223)]){const _0x3454d3=_0x170616['contextMenuCommand'],_0x23b2fb=_0x3454d3[_0xe71989(a23_0x10339d._0x355e3e)];!this[_0xe71989(a23_0x10339d._0x57be2a)][_0xe71989(0x243)][_0xe71989(a23_0x10339d._0x545d9c)](_0x23b2fb)&&this[_0xe71989(0x202)][_0xe71989(0x243)]['set'](_0x23b2fb,_0x170616);_0x4b3da0['push'](_0x3454d3['toJSON']()),_0x10ca8a={'type':'single','name':_0x23b2fb,'folder':_0x5d91c['name'],'kind':'contextMenu'};if(_0x10ca8a)_0x1e8af4[_0xe71989(0x201)](_0x10ca8a);}if(_0x170616['prefixCommand']){const _0x33a6cd=_0x170616[_0xe71989(0x238)],_0x1cd8ea=_0x33a6cd[_0xe71989(0x1d5)]||_0x33a6cd[_0xe71989(a23_0x10339d._0x3de818)];if(_0x1cd8ea){Object['assign'](_0x170616,_0x33a6cd);if(!this['client'][_0xe71989(0x243)][_0xe71989(a23_0x10339d._0x5ba9ad)](_0x1cd8ea))_0x58f503[_0xe71989(a23_0x10339d._0x1efdc8)](_0x1cd8ea)?this[_0xe71989(a23_0x10339d._0x1e418c)][_0xe71989(0x266)](_0xe71989(a23_0x10339d._0x1929be)+_0x1cd8ea+_0xe71989(0x1dc)+_0x42d6de):(_0x58f503[_0xe71989(a23_0x10339d._0x101c20)](_0x1cd8ea),this['client']['commands']['set'](_0x1cd8ea,_0x170616));else{const _0xfc3594=this[_0xe71989(0x202)][_0xe71989(0x243)]['get'](_0x1cd8ea);if(_0xfc3594)Object[_0xe71989(0x1dd)](_0xfc3594,_0x33a6cd);}const _0xc1ef38={'type':'single','name':_0x1cd8ea,'folder':_0x23b1d3[_0xe71989(0x1d5)],'kind':_0x42bcba['HhZlB']};_0x1e8af4['push'](_0xc1ef38),this['commandCategoryMap']['set'](_0x1cd8ea,_0x23b1d3[_0xe71989(0x1d5)]);}}if(!_0x56d602&&!_0x170616['slashCommand']&&!_0x170616[_0xe71989(a23_0x10339d._0x40c41b)]&&!_0x170616['prefixCommand']){const _0x3407a8=this['registerCommand'](_0x170616,_0x773ce3,_0x58f503,_0x4b3da0,_0xcfd9e3,{'folderName':_0x5d91c['name']});if(_0x3407a8)_0x1e8af4['push'](_0x3407a8);}}}}}}return _0x1e8af4;}['_applySubcommandLocalizations'](_0x5644ef,_0x45bfe2,_0x5b7db7){const a23_0x15b1f1={_0x41c92e:0x21e,_0x22b47f:0x1e1,_0x4e1940:0x1d5,_0x386482:0x26a,_0x598ea6:0x254,_0x1986c6:0x26a,_0x93d5ce:0x279,_0x47f902:0x210,_0x6f2bdf:0x1eb,_0x5bf82f:0x252,_0x22125f:0x1f2,_0x45b6ae:0x1f2,_0x2f742c:0x279,_0x27f775:0x24a,_0x14b494:0x268,_0x2c8f18:0x1eb,_0x378b50:0x1f0,_0x119b25:0x1d5,_0x23368c:0x1f0},_0x49d5ca=a23_0x34c86e,_0x8e8a22={'Zsqjx':_0x49d5ca(0x24a),'SXaHl':_0x49d5ca(a23_0x15b1f1._0x41c92e),'gxfVp':function(_0x5691f5,_0x3513c1){return _0x5691f5>_0x3513c1;},'JpAeB':function(_0x5e9e9b,_0xc0ae2a){return _0x5e9e9b!==_0xc0ae2a;},'XlSLb':function(_0x16c24d,_0x51a7eb){return _0x16c24d instanceof _0x51a7eb;},'VoRBz':function(_0x326a59,_0x240d40){return _0x326a59===_0x240d40;}};if(Array['isArray'](_0x5644ef[_0x49d5ca(0x1f2)]))for(const _0x48a10f of _0x5644ef['options']){if(typeof discord_js_1['SlashCommandSubcommandGroupBuilder']!==_0x8e8a22['Zsqjx']&&_0x48a10f instanceof discord_js_1[_0x49d5ca(a23_0x15b1f1._0x22b47f)]){const _0x5154ea=_0x48a10f[_0x49d5ca(a23_0x15b1f1._0x4e1940)],_0x5ece3f={};if(typeof _0x5b7db7[_0x49d5ca(a23_0x15b1f1._0x386482)]==='function')for(const [_0x147e11,_0x592e9a]of _0x5b7db7['entries']()){const _0x3080ce='command_'+_0x45bfe2+'_'+_0x5154ea+'_group_desc';if(_0x592e9a[_0x3080ce])_0x5ece3f[_0x147e11]=_0x592e9a[_0x3080ce];}else for(const _0x3c3fef in _0x5b7db7){const _0x1cccd8=_0x5b7db7[_0x3c3fef],_0x32c8ce=_0x49d5ca(0x268)+_0x45bfe2+'_'+_0x5154ea+_0x49d5ca(0x1d2);if(_0x1cccd8[_0x32c8ce])_0x5ece3f[_0x3c3fef]=_0x1cccd8[_0x32c8ce];}Object['keys'](_0x5ece3f)['length']>0x22d0*-0x1+0xfd*0x20+0x330&&typeof _0x48a10f[_0x49d5ca(0x1f0)]===_0x49d5ca(0x21e)&&_0x48a10f['setDescriptionLocalizations'](_0x5ece3f);if(Array[_0x49d5ca(a23_0x15b1f1._0x598ea6)](_0x48a10f['options']))for(const _0x54cbb1 of _0x48a10f['options']){const _0x387757=_0x54cbb1['name'],_0x5f239e={};if(typeof _0x5b7db7[_0x49d5ca(a23_0x15b1f1._0x1986c6)]===_0x8e8a22[_0x49d5ca(a23_0x15b1f1._0x93d5ce)])for(const [_0x1f2634,_0x192de3]of _0x5b7db7['entries']()){const _0x57a59b='command_'+_0x45bfe2+'_'+_0x5154ea+'_'+_0x387757+_0x49d5ca(0x210);if(_0x192de3[_0x57a59b])_0x5f239e[_0x1f2634]=_0x192de3[_0x57a59b];}else for(const _0x278f71 in _0x5b7db7){const _0xfb83bf=_0x5b7db7[_0x278f71],_0x3d89f3='command_'+_0x45bfe2+'_'+_0x5154ea+'_'+_0x387757+_0x49d5ca(a23_0x15b1f1._0x47f902);if(_0xfb83bf[_0x3d89f3])_0x5f239e[_0x278f71]=_0xfb83bf[_0x3d89f3];}Object[_0x49d5ca(a23_0x15b1f1._0x6f2bdf)](_0x5f239e)[_0x49d5ca(a23_0x15b1f1._0x5bf82f)]>0x1490*-0x1+0x1cd3+-0x843&&typeof _0x54cbb1[_0x49d5ca(0x1f0)]===_0x8e8a22[_0x49d5ca(0x279)]&&_0x54cbb1[_0x49d5ca(0x1f0)](_0x5f239e);if(Array[_0x49d5ca(0x254)](_0x54cbb1[_0x49d5ca(a23_0x15b1f1._0x22125f)]))for(const _0x2ddba2 of _0x54cbb1[_0x49d5ca(a23_0x15b1f1._0x45b6ae)]){const _0x2f3674=_0x2ddba2['name'],_0x12daeb={};if(typeof _0x5b7db7['entries']===_0x8e8a22[_0x49d5ca(a23_0x15b1f1._0x2f742c)])for(const [_0x5a28c7,_0x2bde57]of _0x5b7db7['entries']()){const _0x5a6323='command_'+_0x45bfe2+'_'+_0x5154ea+'_'+_0x387757+'_option_'+_0x2f3674;if(_0x2bde57[_0x5a6323])_0x12daeb[_0x5a28c7]=_0x2bde57[_0x5a6323];}else for(const _0x2f8f92 in _0x5b7db7){const _0x3196e1=_0x5b7db7[_0x2f8f92],_0x382eb3='command_'+_0x45bfe2+'_'+_0x5154ea+'_'+_0x387757+'_option_'+_0x2f3674;if(_0x3196e1[_0x382eb3])_0x12daeb[_0x2f8f92]=_0x3196e1[_0x382eb3];}_0x8e8a22['gxfVp'](Object['keys'](_0x12daeb)[_0x49d5ca(0x252)],-0x1819*0x1+0x1097+-0x1f*-0x3e)&&typeof _0x2ddba2[_0x49d5ca(0x1f0)]==='function'&&_0x2ddba2['setDescriptionLocalizations'](_0x12daeb);}}}else{if(_0x8e8a22[_0x49d5ca(0x255)](typeof discord_js_1['SlashCommandSubcommandBuilder'],_0x49d5ca(a23_0x15b1f1._0x27f775))&&_0x8e8a22['XlSLb'](_0x48a10f,discord_js_1[_0x49d5ca(0x1e9)])){const _0x2cccd7=_0x48a10f['name'],_0x388837={};if(_0x8e8a22['VoRBz'](typeof _0x5b7db7['entries'],'function'))for(const [_0x27386e,_0x190e88]of _0x5b7db7['entries']()){const _0x3e3716=_0x49d5ca(a23_0x15b1f1._0x14b494)+_0x45bfe2+'_'+_0x2cccd7+'_desc';if(_0x190e88[_0x3e3716])_0x388837[_0x27386e]=_0x190e88[_0x3e3716];}else for(const _0x595e61 in _0x5b7db7){const _0x3db60e=_0x5b7db7[_0x595e61],_0xb37203='command_'+_0x45bfe2+'_'+_0x2cccd7+'_desc';if(_0x3db60e[_0xb37203])_0x388837[_0x595e61]=_0x3db60e[_0xb37203];}_0x8e8a22[_0x49d5ca(0x1c8)](Object[_0x49d5ca(a23_0x15b1f1._0x2c8f18)](_0x388837)[_0x49d5ca(0x252)],-0x2*-0xce5+0x111b+0x1*-0x2ae5)&&typeof _0x48a10f[_0x49d5ca(a23_0x15b1f1._0x378b50)]===_0x8e8a22[_0x49d5ca(a23_0x15b1f1._0x93d5ce)]&&_0x48a10f[_0x49d5ca(0x1f0)](_0x388837);if(Array[_0x49d5ca(a23_0x15b1f1._0x598ea6)](_0x48a10f[_0x49d5ca(0x1f2)]))for(const _0x48d3f4 of _0x48a10f[_0x49d5ca(0x1f2)]){const _0x5b26d2=_0x48d3f4[_0x49d5ca(a23_0x15b1f1._0x119b25)],_0x366460={};if(typeof _0x5b7db7['entries']==='function')for(const [_0x537d98,_0x1ef894]of _0x5b7db7[_0x49d5ca(a23_0x15b1f1._0x386482)]()){const _0x516040=_0x49d5ca(0x268)+_0x45bfe2+'_'+_0x2cccd7+_0x49d5ca(0x1f1)+_0x5b26d2;if(_0x1ef894[_0x516040])_0x366460[_0x537d98]=_0x1ef894[_0x516040];}else for(const _0x3fa250 in _0x5b7db7){const _0x1bcd57=_0x5b7db7[_0x3fa250],_0x1ee21e='command_'+_0x45bfe2+'_'+_0x2cccd7+_0x49d5ca(0x1f1)+_0x5b26d2;if(_0x1bcd57[_0x1ee21e])_0x366460[_0x3fa250]=_0x1bcd57[_0x1ee21e];}Object['keys'](_0x366460)['length']>-0x1e1e+0x16fb+0x723&&typeof _0x48d3f4[_0x49d5ca(a23_0x15b1f1._0x23368c)]===_0x8e8a22['SXaHl']&&_0x48d3f4[_0x49d5ca(0x1f0)](_0x366460);}}}}}[a23_0x34c86e(0x25f)](_0x2fa00a){const a23_0x30936e={_0x2da518:0x1d1,_0x1573a0:0x278,_0x11d060:0x1d5,_0x321502:0x240,_0x449577:0x1db,_0x42758e:0x23f,_0x1d9c74:0x230,_0x43378c:0x27e,_0x16199b:0x1e4,_0x51d77c:0x1fa,_0x5a0e22:0x244,_0x495466:0x252,_0xb05915:0x240},_0x22f089=a23_0x34c86e,_0x385efd={'ueBqH':_0x22f089(a23_0x30936e._0x2da518),'jCzmA':function(_0x3cf870,_0x198e7b){return _0x3cf870===_0x198e7b;},'xmRkm':function(_0x240b48,_0x25e1e0){return _0x240b48===_0x25e1e0;},'uhdyk':'\x20\x20🌐\x20\x20Locales:\x20Loaded','ftmEL':_0x22f089(0x1f6)};this['logger']['info'](_0x22f089(a23_0x30936e._0x1573a0));for(const _0x1a965e of _0x2fa00a){this[_0x22f089(0x1fa)][_0x22f089(0x240)](_0x22f089(0x1c9)+_0x1a965e[_0x22f089(a23_0x30936e._0x11d060)]+'\x20(v'+_0x1a965e['version']+')'),this['logger']['info'](_0x385efd['ueBqH']);if(!_0x1a965e['commands'][_0x22f089(0x252)])this['logger']['info']('\x20\x20\x20\x20\x20(no\x20commands\x20registered)');else for(const _0xbeae7a of _0x1a965e['commands']){if(_0x385efd['jCzmA'](_0xbeae7a['type'],'group')){this[_0x22f089(0x1fa)][_0x22f089(a23_0x30936e._0x321502)](_0x22f089(0x219)+_0xbeae7a['name']);for(const _0x55cc5b of _0xbeae7a['subcommands']){if(typeof _0x55cc5b===_0x22f089(a23_0x30936e._0x449577))this['logger'][_0x22f089(a23_0x30936e._0x321502)](_0x22f089(0x20b)+_0x55cc5b);else{if(typeof _0x55cc5b==='object'&&_0x55cc5b[_0x22f089(0x200)]){this['logger'][_0x22f089(0x240)](_0x22f089(0x22f)+_0x55cc5b['group']+']');for(const _0x191f70 of _0x55cc5b[_0x22f089(a23_0x30936e._0x42758e)]){this['logger'][_0x22f089(0x240)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20└─\x20'+_0x191f70);}}}}}else{if(_0xbeae7a[_0x22f089(0x260)]==='single'){let _0x445759='';if(_0x385efd[_0x22f089(a23_0x30936e._0x1d9c74)](_0xbeae7a[_0x22f089(0x1f3)],'slash'))_0x445759=_0x22f089(0x27b);else{if(_0xbeae7a[_0x22f089(0x1f3)]===_0x22f089(0x1cc))_0x445759=_0x22f089(a23_0x30936e._0x43378c);else{if(_0xbeae7a['kind']===_0x22f089(0x24c))_0x445759=_0x22f089(0x203);}}const _0x18f31f=_0xbeae7a['kind']==='prefix'?'!':'/';_0xbeae7a[_0x22f089(a23_0x30936e._0x16199b)]?this[_0x22f089(a23_0x30936e._0x51d77c)][_0x22f089(a23_0x30936e._0x321502)](_0x22f089(a23_0x30936e._0x5a0e22)+_0x18f31f+_0xbeae7a['name']+'\x20('+_0xbeae7a['folder']+')'+_0x445759):this[_0x22f089(a23_0x30936e._0x51d77c)]['info'](_0x22f089(0x244)+_0x18f31f+_0xbeae7a['name']+_0x445759);}}}_0x1a965e['hasLocales']&&this[_0x22f089(0x1fa)]['info'](_0x385efd[_0x22f089(0x224)]);if(_0x1a965e['register']?.[_0x22f089(a23_0x30936e._0x495466)]){this['logger'][_0x22f089(0x240)](_0x385efd['ftmEL']);for(const _0x5246c0 of _0x1a965e[_0x22f089(0x1f5)]){this['logger'][_0x22f089(a23_0x30936e._0xb05915)]('\x20\x20\x20'+_0x5246c0);}}if(_0x1a965e[_0x22f089(0x24d)]?.[_0x22f089(0x252)]){this['logger'][_0x22f089(0x240)](_0x22f089(0x212));for(const _0x305c1c of _0x1a965e['events']){this['logger']['info']('\x20\x20\x20\x20\x20└─\x20'+_0x305c1c);}}}}[a23_0x34c86e(0x1d3)](){const a23_0x223d1a={_0x2a0246:0x216,_0x5cfa29:0x208},_0x2a4d5c=a23_0x34c86e;return{'buttonHandlers':this['buttonHandlers'],'modalHandlers':this['modalHandlers'],'selectMenuHandlers':this[_0x2a4d5c(a23_0x223d1a._0x2a0246)],'autocompleteHandlers':this['autocompleteHandlers'],'commandCategoryMap':this['commandCategoryMap'],'categoryToFeatureMap':this[_0x2a4d5c(0x1cb)],'eventHandlers':this[_0x2a4d5c(a23_0x223d1a._0x5cfa29)]};}}exports[a23_0x34c86e(0x1e0)]=AddonManager;
|