kythia-core 0.12.4-beta → 0.12.5-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.
Files changed (33) hide show
  1. package/dist/Kythia.js +0 -5
  2. package/dist/Kythia.js.map +1 -1
  3. package/dist/KythiaClient.d.ts.map +1 -1
  4. package/dist/KythiaClient.js +7 -0
  5. package/dist/KythiaClient.js.map +1 -1
  6. package/dist/cli/commands/MakeMigrationCommand.js +1 -1
  7. package/dist/cli/commands/MakeModelCommand.js +1 -1
  8. package/dist/managers/AddonManager.d.ts.map +1 -1
  9. package/dist/managers/AddonManager.js +95 -45
  10. package/dist/managers/AddonManager.js.map +1 -1
  11. package/dist/managers/EventManager.d.ts.map +1 -1
  12. package/dist/managers/EventManager.js +73 -26
  13. package/dist/managers/EventManager.js.map +1 -1
  14. package/dist/managers/InteractionManager.d.ts.map +1 -1
  15. package/dist/managers/InteractionManager.js +198 -134
  16. package/dist/managers/InteractionManager.js.map +1 -1
  17. package/dist/managers/MiddlewareManager.d.ts.map +1 -1
  18. package/dist/managers/MiddlewareManager.js +64 -35
  19. package/dist/managers/MiddlewareManager.js.map +1 -1
  20. package/dist/managers/ShutdownManager.d.ts.map +1 -1
  21. package/dist/managers/ShutdownManager.js +109 -81
  22. package/dist/managers/ShutdownManager.js.map +1 -1
  23. package/dist/managers/TelemetryManager.d.ts.map +1 -1
  24. package/dist/managers/TelemetryManager.js +98 -52
  25. package/dist/managers/TelemetryManager.js.map +1 -1
  26. package/dist/managers/TranslatorManager.d.ts +1 -0
  27. package/dist/managers/TranslatorManager.d.ts.map +1 -1
  28. package/dist/managers/TranslatorManager.js +78 -61
  29. package/dist/managers/TranslatorManager.js.map +1 -1
  30. package/dist/utils/InteractionFactory.d.ts.map +1 -1
  31. package/dist/utils/InteractionFactory.js +305 -281
  32. package/dist/utils/InteractionFactory.js.map +1 -1
  33. package/package.json +1 -1
@@ -3,308 +3,332 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InteractionFactory = void 0;
4
4
  exports.InteractionFactory = {
5
5
  create(message, commandName, rawArgsString) {
6
- let replied = false;
7
- let deferred = false;
8
- let replyMessage = null;
9
- const followUpMessages = [];
10
- const argsPattern = /([^\s"]+|"[^"]*")+/g;
11
- const rawTokens = rawArgsString.match(argsPattern)?.map((t) => t.replace(/^"|"$/g, '')) ||
12
- [];
13
- const client = message.client;
14
- const targetCommand = client.commands?.get(commandName);
15
- let resolvedGroup = null;
16
- let resolvedSubcommand = null;
17
- const resolvedOptions = [];
18
- const remainingArgs = [...rawTokens];
19
- let currentSchema = targetCommand?.slashCommand || targetCommand?.data;
20
- if (remainingArgs.length > 0 && currentSchema?.options) {
21
- const potentialGroup = remainingArgs[0].toLowerCase();
22
- const groupOption = currentSchema.options.find((opt) => opt.name === potentialGroup &&
23
- (opt.type === 2 ||
24
- opt.constructor.name === 'SlashCommandSubcommandGroupBuilder'));
25
- if (groupOption) {
26
- resolvedGroup = potentialGroup;
27
- remainingArgs.shift();
28
- currentSchema = groupOption;
6
+ try {
7
+ let replied = false;
8
+ let deferred = false;
9
+ let replyMessage = null;
10
+ const followUpMessages = [];
11
+ const argsPattern = /([^\s"]+|"[^"]*")+/g;
12
+ const rawTokens = rawArgsString.match(argsPattern)?.map((t) => t.replace(/^"|"$/g, '')) ||
13
+ [];
14
+ const client = message.client;
15
+ const targetCommand = client.commands?.get(commandName);
16
+ let resolvedGroup = null;
17
+ let resolvedSubcommand = null;
18
+ const resolvedOptions = [];
19
+ const remainingArgs = [...rawTokens];
20
+ let currentSchema = targetCommand?.slashCommand || targetCommand?.data;
21
+ if (remainingArgs.length > 0 && currentSchema?.options) {
22
+ const potentialGroup = remainingArgs[0].toLowerCase();
23
+ const groupOption = currentSchema.options.find((opt) => opt.name === potentialGroup &&
24
+ (opt.type === 2 ||
25
+ opt.constructor.name === 'SlashCommandSubcommandGroupBuilder'));
26
+ if (groupOption) {
27
+ resolvedGroup = potentialGroup;
28
+ remainingArgs.shift();
29
+ currentSchema = groupOption;
30
+ }
29
31
  }
30
- }
31
- if (remainingArgs.length > 0) {
32
- const potentialSub = remainingArgs[0].toLowerCase();
33
- const subOptionsSource = currentSchema?.options || [];
34
- const subOption = subOptionsSource.find((opt) => opt.name === potentialSub &&
35
- (opt.type === 1 ||
36
- opt.constructor.name === 'SlashCommandSubcommandBuilder'));
37
- if (resolvedGroup || subOption) {
38
- resolvedSubcommand = potentialSub;
39
- remainingArgs.shift();
40
- currentSchema = subOption;
32
+ if (remainingArgs.length > 0) {
33
+ const potentialSub = remainingArgs[0].toLowerCase();
34
+ const subOptionsSource = currentSchema?.options || [];
35
+ const subOption = subOptionsSource.find((opt) => opt.name === potentialSub &&
36
+ (opt.type === 1 ||
37
+ opt.constructor.name === 'SlashCommandSubcommandBuilder'));
38
+ if (resolvedGroup || subOption) {
39
+ resolvedSubcommand = potentialSub;
40
+ remainingArgs.shift();
41
+ currentSchema = subOption;
42
+ }
41
43
  }
42
- }
43
- const optionsMap = new Map();
44
- const availableOptions = currentSchema?.options?.filter((opt) => opt.type !== 1 &&
45
- opt.type !== 2 &&
46
- opt.constructor.name !== 'SlashCommandSubcommandBuilder' &&
47
- opt.constructor.name !== 'SlashCommandSubcommandGroupBuilder') || [];
48
- let positionalIndex = 0;
49
- const guessType = (val) => {
50
- if (!Number.isNaN(Number(val)))
44
+ const optionsMap = new Map();
45
+ const availableOptions = currentSchema?.options?.filter((opt) => opt.type !== 1 &&
46
+ opt.type !== 2 &&
47
+ opt.constructor.name !== 'SlashCommandSubcommandBuilder' &&
48
+ opt.constructor.name !== 'SlashCommandSubcommandGroupBuilder') || [];
49
+ let positionalIndex = 0;
50
+ const guessType = (val) => {
51
+ if (!Number.isNaN(Number(val)))
52
+ return 3;
53
+ if (val === 'true' || val === 'false')
54
+ return 5;
51
55
  return 3;
52
- if (val === 'true' || val === 'false')
53
- return 5;
54
- return 3;
55
- };
56
- remainingArgs.forEach((arg) => {
57
- if (arg.includes(':')) {
58
- const [key, ...valParts] = arg.split(':');
59
- const val = valParts.join(':');
60
- resolvedOptions.push({
61
- name: key.toLowerCase(),
62
- value: val,
63
- type: guessType(val),
64
- });
65
- optionsMap.set(key.toLowerCase(), val);
66
- }
67
- else {
68
- if (positionalIndex < availableOptions.length) {
69
- const targetOption = availableOptions[positionalIndex];
56
+ };
57
+ remainingArgs.forEach((arg) => {
58
+ if (arg.includes(':')) {
59
+ const [key, ...valParts] = arg.split(':');
60
+ const val = valParts.join(':');
70
61
  resolvedOptions.push({
71
- name: targetOption.name.toLowerCase(),
72
- value: arg,
73
- type: targetOption.type || guessType(arg),
62
+ name: key.toLowerCase(),
63
+ value: val,
64
+ type: guessType(val),
74
65
  });
75
- optionsMap.set(targetOption.name.toLowerCase(), arg);
76
- positionalIndex++;
77
- }
78
- }
79
- });
80
- const resolveUser = (val) => {
81
- if (!val)
82
- return null;
83
- const id = val.replace(/[<@!>]/g, '');
84
- return message.client.users.cache.get(id) || null;
85
- };
86
- const resolveMember = (val) => {
87
- const user = resolveUser(val);
88
- return user ? message.guild?.members.cache.get(user.id) || null : null;
89
- };
90
- const resolveChannel = (val) => {
91
- if (!val)
92
- return null;
93
- const id = val.replace(/[<#>]/g, '');
94
- return message.guild?.channels.cache.get(id) || null;
95
- };
96
- const resolveRole = (val) => {
97
- if (!val)
98
- return null;
99
- const id = val.replace(/[<@&>]/g, '');
100
- return message.guild?.roles.cache.get(id) || null;
101
- };
102
- const interaction = {
103
- type: 2,
104
- id: message.id,
105
- applicationId: message.client.application?.id,
106
- channelId: message.channel.id,
107
- guildId: message.guild?.id,
108
- user: message.author,
109
- member: message.member,
110
- guild: message.guild,
111
- channel: message.channel,
112
- client: message.client,
113
- commandName: commandName,
114
- commandType: 1,
115
- commandId: message.id,
116
- commandGuildId: message.guild?.id || null,
117
- get responded() {
118
- return replied || deferred;
119
- },
120
- get deferred() {
121
- return deferred;
122
- },
123
- get replied() {
124
- return replied;
125
- },
126
- set deferred(v) {
127
- deferred = v;
128
- },
129
- set replied(v) {
130
- replied = v;
131
- },
132
- createdTimestamp: message.createdTimestamp,
133
- get createdAt() {
134
- return new Date(message.createdTimestamp);
135
- },
136
- locale: message.guild?.preferredLocale || 'en-US',
137
- guildLocale: message.guild?.preferredLocale || 'en-US',
138
- deferReply: async (opts) => {
139
- if (replied || deferred)
140
- throw new Error('Already replied/deferred');
141
- deferred = true;
142
- replyMessage = await message.channel
143
- .send({ content: '⏳ ...', ...opts })
144
- .catch(() => null);
145
- return replyMessage;
146
- },
147
- editReply: async (opts) => {
148
- const options = typeof opts === 'string' ? { content: opts } : opts;
149
- if (replyMessage && replyMessage.content === '⏳ ...') {
150
- await replyMessage.delete().catch(() => { });
151
- replyMessage = await message.channel
152
- .send(options)
153
- .catch(() => null);
154
- }
155
- else if (replyMessage) {
156
- replyMessage = await replyMessage
157
- .edit(options)
158
- .catch(() => null);
66
+ optionsMap.set(key.toLowerCase(), val);
159
67
  }
160
68
  else {
161
- replyMessage = await message.channel
162
- .send(options)
163
- .catch(() => null);
69
+ if (positionalIndex < availableOptions.length) {
70
+ const targetOption = availableOptions[positionalIndex];
71
+ resolvedOptions.push({
72
+ name: targetOption.name.toLowerCase(),
73
+ value: arg,
74
+ type: targetOption.type || guessType(arg),
75
+ });
76
+ optionsMap.set(targetOption.name.toLowerCase(), arg);
77
+ positionalIndex++;
78
+ }
164
79
  }
165
- replied = true;
166
- return replyMessage;
167
- },
168
- reply: async (opts) => {
169
- if (replied || deferred)
170
- return interaction.editReply(opts);
171
- replied = true;
172
- replyMessage = await message.channel
173
- .send(opts)
174
- .catch(() => null);
175
- return replyMessage;
176
- },
177
- followUp: async (opts) => {
178
- const msg = await message.channel
179
- .send(opts)
180
- .catch(() => null);
181
- if (msg)
182
- followUpMessages.push(msg);
183
- return msg;
184
- },
185
- deleteReply: async () => {
186
- if (replyMessage)
187
- await replyMessage.delete().catch(() => { });
188
- replyMessage = null;
189
- },
190
- fetchReply: async () => replyMessage,
191
- options: {
80
+ });
81
+ const resolveUser = (val) => {
82
+ if (!val)
83
+ return null;
84
+ const id = val.replace(/[<@!>]/g, '');
85
+ return message.client.users.cache.get(id) || null;
86
+ };
87
+ const resolveMember = (val) => {
88
+ const user = resolveUser(val);
89
+ return user ? message.guild?.members.cache.get(user.id) || null : null;
90
+ };
91
+ const resolveChannel = (val) => {
92
+ if (!val)
93
+ return null;
94
+ const id = val.replace(/[<#>]/g, '');
95
+ return message.guild?.channels.cache.get(id) || null;
96
+ };
97
+ const resolveRole = (val) => {
98
+ if (!val)
99
+ return null;
100
+ const id = val.replace(/[<@&>]/g, '');
101
+ return message.guild?.roles.cache.get(id) || null;
102
+ };
103
+ const interaction = {
104
+ type: 2,
105
+ id: message.id,
106
+ applicationId: message.client.application?.id,
107
+ channelId: message.channel.id,
108
+ guildId: message.guild?.id,
109
+ user: message.author,
110
+ member: message.member,
111
+ guild: message.guild,
112
+ channel: message.channel,
192
113
  client: message.client,
193
- data: resolvedOptions,
194
- resolved: {
195
- users: new Map(),
196
- members: new Map(),
197
- channels: new Map(),
198
- roles: new Map(),
199
- attachments: new Map(),
200
- messages: new Map(),
201
- },
202
- _group: resolvedGroup,
203
- _subcommand: resolvedSubcommand,
204
- _hoistedOptions: resolvedOptions,
205
- get: (name, required) => {
206
- const opt = resolvedOptions.find((o) => o.name === name.toLowerCase());
207
- if (required && !opt)
208
- throw new Error(`Option "${name}" required`);
209
- return opt || null;
210
- },
211
- getSubcommand: (required) => {
212
- if (required && !resolvedSubcommand)
213
- throw new Error('Subcommand required');
214
- return resolvedSubcommand;
114
+ commandName: commandName,
115
+ commandType: 1,
116
+ commandId: message.id,
117
+ commandGuildId: message.guild?.id || null,
118
+ get responded() {
119
+ return replied || deferred;
215
120
  },
216
- getSubcommandGroup: (required) => {
217
- if (required && !resolvedGroup)
218
- throw new Error('Group required');
219
- return resolvedGroup;
121
+ get deferred() {
122
+ return deferred;
220
123
  },
221
- getString: (name, required) => {
222
- const v = optionsMap.get(name.toLowerCase());
223
- if (required && v === undefined)
224
- throw new Error(`Option "${name}" required`);
225
- return v || null;
124
+ get replied() {
125
+ return replied;
226
126
  },
227
- getBoolean: (name, required) => {
228
- const v = optionsMap.get(name.toLowerCase());
229
- if (required && v === undefined)
230
- throw new Error(`Option "${name}" required`);
231
- return v ? v === 'true' || v === '1' : null;
127
+ set deferred(v) {
128
+ deferred = v;
232
129
  },
233
- getInteger: (name, required) => {
234
- const v = optionsMap.get(name.toLowerCase());
235
- if (required && v === undefined)
236
- throw new Error(`Option "${name}" required`);
237
- return v ? parseInt(v, 10) : null;
130
+ set replied(v) {
131
+ replied = v;
238
132
  },
239
- getNumber: (name, required) => {
240
- const v = optionsMap.get(name.toLowerCase());
241
- if (required && v === undefined)
242
- throw new Error(`Option "${name}" required`);
243
- return v ? parseFloat(v) : null;
133
+ createdTimestamp: message.createdTimestamp,
134
+ get createdAt() {
135
+ return new Date(message.createdTimestamp);
244
136
  },
245
- getUser: (name, required) => {
246
- const u = resolveUser(optionsMap.get(name.toLowerCase()));
247
- if (required && !u)
248
- throw new Error(`Option "${name}" required`);
249
- return u;
250
- },
251
- getMember: (name) => resolveMember(optionsMap.get(name.toLowerCase())),
252
- getChannel: (name, required) => {
253
- const c = resolveChannel(optionsMap.get(name.toLowerCase()));
254
- if (required && !c)
255
- throw new Error(`Option "${name}" required`);
256
- return c;
137
+ locale: message.guild?.preferredLocale || 'en-US',
138
+ guildLocale: message.guild?.preferredLocale || 'en-US',
139
+ deferReply: async (opts) => {
140
+ if (replied || deferred)
141
+ throw new Error('Already replied/deferred');
142
+ deferred = true;
143
+ replyMessage = await message.channel
144
+ .send({ content: '⏳ ...', ...opts })
145
+ .catch(() => null);
146
+ return replyMessage;
257
147
  },
258
- getRole: (name, required) => {
259
- const r = resolveRole(optionsMap.get(name.toLowerCase()));
260
- if (required && !r)
261
- throw new Error(`Option "${name}" required`);
262
- return r;
148
+ editReply: async (opts) => {
149
+ const options = typeof opts === 'string' ? { content: opts } : opts;
150
+ if (replyMessage && replyMessage.content === '⏳ ...') {
151
+ await replyMessage.delete().catch(() => { });
152
+ replyMessage = await message.channel
153
+ .send(options)
154
+ .catch(() => null);
155
+ }
156
+ else if (replyMessage) {
157
+ replyMessage = await replyMessage
158
+ .edit(options)
159
+ .catch(() => null);
160
+ }
161
+ else {
162
+ replyMessage = await message.channel
163
+ .send(options)
164
+ .catch(() => null);
165
+ }
166
+ replied = true;
167
+ return replyMessage;
263
168
  },
264
- getAttachment: (name, required) => {
265
- const a = message.attachments.first();
266
- if (required && !a)
267
- throw new Error(`Option "${name}" required`);
268
- return a || null;
169
+ reply: async (opts) => {
170
+ if (replied || deferred)
171
+ return interaction.editReply(opts);
172
+ replied = true;
173
+ replyMessage = await message.channel
174
+ .send(opts)
175
+ .catch(() => null);
176
+ return replyMessage;
269
177
  },
270
- getMentionable: (name, required) => {
271
- const v = optionsMap.get(name.toLowerCase());
272
- const m = resolveUser(v) || resolveRole(v);
273
- if (required && !m)
274
- throw new Error(`Option "${name}" required`);
275
- return m;
178
+ followUp: async (opts) => {
179
+ const msg = await message.channel
180
+ .send(opts)
181
+ .catch(() => null);
182
+ if (msg)
183
+ followUpMessages.push(msg);
184
+ return msg;
276
185
  },
277
- getMessage: (name, required) => {
278
- if (required)
279
- throw new Error(`Option "${name}" required`);
280
- return null;
186
+ deleteReply: async () => {
187
+ if (replyMessage)
188
+ await replyMessage.delete().catch(() => { });
189
+ replyMessage = null;
281
190
  },
282
- getFocused: (getFull) => {
283
- return getFull ? { name: '', value: '', type: 3 } : '';
191
+ fetchReply: async () => replyMessage,
192
+ options: {
193
+ client: message.client,
194
+ data: resolvedOptions,
195
+ resolved: {
196
+ users: new Map(),
197
+ members: new Map(),
198
+ channels: new Map(),
199
+ roles: new Map(),
200
+ attachments: new Map(),
201
+ messages: new Map(),
202
+ },
203
+ _group: resolvedGroup,
204
+ _subcommand: resolvedSubcommand,
205
+ _hoistedOptions: resolvedOptions,
206
+ get: (name, required) => {
207
+ const opt = resolvedOptions.find((o) => o.name === name.toLowerCase());
208
+ if (required && !opt)
209
+ throw new Error(`Option "${name}" required`);
210
+ return opt || null;
211
+ },
212
+ getSubcommand: (required) => {
213
+ if (required && !resolvedSubcommand)
214
+ throw new Error('Subcommand required');
215
+ return resolvedSubcommand;
216
+ },
217
+ getSubcommandGroup: (required) => {
218
+ if (required && !resolvedGroup)
219
+ throw new Error('Group required');
220
+ return resolvedGroup;
221
+ },
222
+ getString: (name, required) => {
223
+ const v = optionsMap.get(name.toLowerCase());
224
+ if (required && v === undefined)
225
+ throw new Error(`Option "${name}" required`);
226
+ return v || null;
227
+ },
228
+ getBoolean: (name, required) => {
229
+ const v = optionsMap.get(name.toLowerCase());
230
+ if (required && v === undefined)
231
+ throw new Error(`Option "${name}" required`);
232
+ return v ? v === 'true' || v === '1' : null;
233
+ },
234
+ getInteger: (name, required) => {
235
+ const v = optionsMap.get(name.toLowerCase());
236
+ if (required && v === undefined)
237
+ throw new Error(`Option "${name}" required`);
238
+ return v ? parseInt(v, 10) : null;
239
+ },
240
+ getNumber: (name, required) => {
241
+ const v = optionsMap.get(name.toLowerCase());
242
+ if (required && v === undefined)
243
+ throw new Error(`Option "${name}" required`);
244
+ return v ? parseFloat(v) : null;
245
+ },
246
+ getUser: (name, required) => {
247
+ const u = resolveUser(optionsMap.get(name.toLowerCase()));
248
+ if (required && !u)
249
+ throw new Error(`Option "${name}" required`);
250
+ return u;
251
+ },
252
+ getMember: (name) => resolveMember(optionsMap.get(name.toLowerCase())),
253
+ getChannel: (name, required) => {
254
+ const c = resolveChannel(optionsMap.get(name.toLowerCase()));
255
+ if (required && !c)
256
+ throw new Error(`Option "${name}" required`);
257
+ return c;
258
+ },
259
+ getRole: (name, required) => {
260
+ const r = resolveRole(optionsMap.get(name.toLowerCase()));
261
+ if (required && !r)
262
+ throw new Error(`Option "${name}" required`);
263
+ return r;
264
+ },
265
+ getAttachment: (name, required) => {
266
+ const a = message.attachments.first();
267
+ if (required && !a)
268
+ throw new Error(`Option "${name}" required`);
269
+ return a || null;
270
+ },
271
+ getMentionable: (name, required) => {
272
+ const v = optionsMap.get(name.toLowerCase());
273
+ const m = resolveUser(v) || resolveRole(v);
274
+ if (required && !m)
275
+ throw new Error(`Option "${name}" required`);
276
+ return m;
277
+ },
278
+ getMessage: (name, required) => {
279
+ if (required)
280
+ throw new Error(`Option "${name}" required`);
281
+ return null;
282
+ },
283
+ getFocused: (getFull) => {
284
+ return getFull ? { name: '', value: '', type: 3 } : '';
285
+ },
284
286
  },
285
- },
286
- isCommand: () => true,
287
- isChatInputCommand: () => true,
288
- isContextMenuCommand: () => false,
289
- isMessageContextMenuCommand: () => false,
290
- isUserContextMenuCommand: () => false,
291
- isMessageComponent: () => false,
292
- isButton: () => false,
293
- isStringSelectMenu: () => false,
294
- isSelectMenu: () => false,
295
- isUserSelectMenu: () => false,
296
- isRoleSelectMenu: () => false,
297
- isMentionableSelectMenu: () => false,
298
- isChannelSelectMenu: () => false,
299
- isAutocomplete: () => false,
300
- isModalSubmit: () => false,
301
- isRepliable: () => true,
302
- inGuild: () => !!message.guild,
303
- inCachedGuild: () => !!message.guild,
304
- inRawGuild: () => false,
305
- toString: () => `/${commandName} ${rawArgsString}`.trim(),
306
- };
307
- return interaction;
287
+ isCommand: () => true,
288
+ isChatInputCommand: () => true,
289
+ isContextMenuCommand: () => false,
290
+ isMessageContextMenuCommand: () => false,
291
+ isUserContextMenuCommand: () => false,
292
+ isMessageComponent: () => false,
293
+ isButton: () => false,
294
+ isStringSelectMenu: () => false,
295
+ isSelectMenu: () => false,
296
+ isUserSelectMenu: () => false,
297
+ isRoleSelectMenu: () => false,
298
+ isMentionableSelectMenu: () => false,
299
+ isChannelSelectMenu: () => false,
300
+ isAutocomplete: () => false,
301
+ isModalSubmit: () => false,
302
+ isRepliable: () => true,
303
+ inGuild: () => !!message.guild,
304
+ inCachedGuild: () => !!message.guild,
305
+ inRawGuild: () => false,
306
+ toString: () => `/${commandName} ${rawArgsString}`.trim(),
307
+ };
308
+ let commandKey = commandName;
309
+ if (resolvedGroup)
310
+ commandKey = `${commandKey} ${resolvedGroup} ${resolvedSubcommand}`;
311
+ else if (resolvedSubcommand)
312
+ commandKey = `${commandKey} ${resolvedSubcommand}`;
313
+ client.container?.telemetry?.report('info', `Command Executed (Mock): /${commandKey}`, {
314
+ user: `${message.author.tag} (${message.author.id})`,
315
+ guild: message.guild
316
+ ? `${message.guild.name} (${message.guild.id})`
317
+ : 'DM',
318
+ channel: message.channel.id,
319
+ type: 'Prefix/Mock',
320
+ });
321
+ return interaction;
322
+ }
323
+ catch (error) {
324
+ const client = message.client;
325
+ client.container?.logger?.error('Error creating mock interaction:', error);
326
+ client.container?.telemetry?.report('error', `Mock Interaction Creation Failed: [${commandName}]`, {
327
+ message: error.message,
328
+ stack: error.stack,
329
+ });
330
+ throw error;
331
+ }
308
332
  },
309
333
  };
310
334
  //# sourceMappingURL=InteractionFactory.js.map