xernerx 3.5.0 → 3.5.2

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 (114) hide show
  1. package/dist/cjs/build/ContextCommandBuilder.js +97 -0
  2. package/dist/cjs/build/EventBuilder.js +44 -0
  3. package/dist/cjs/build/InhibitorBuilder.js +37 -0
  4. package/dist/cjs/build/MessageCommandBuilder.js +100 -0
  5. package/{types → dist/cjs}/build/SlashCommandBuilder.d.ts +2 -1
  6. package/dist/cjs/build/SlashCommandBuilder.js +169 -0
  7. package/dist/cjs/client/XernerxClient.js +116 -0
  8. package/dist/{handlers → cjs/handlers}/CommandHandler.js +11 -8
  9. package/dist/{handlers → cjs/handlers}/EventHandler.js +6 -3
  10. package/dist/cjs/handlers/Handler.js +308 -0
  11. package/dist/{handlers → cjs/handlers}/InhibitorHandler.js +6 -3
  12. package/dist/cjs/main.js +112 -0
  13. package/dist/{models → cjs/models}/CommandArguments.js +37 -52
  14. package/dist/cjs/models/Events.js +307 -0
  15. package/dist/cjs/models/Extensions.js +26 -0
  16. package/dist/{tools → cjs/tools}/XernerxError.js +4 -1
  17. package/{types → dist/cjs}/tools/package.d.ts +11 -0
  18. package/dist/cjs/tools/package.js +50 -0
  19. package/dist/cjs/types/enums.js +38 -0
  20. package/dist/cjs/types/interfaces.js +2 -0
  21. package/dist/cjs/types/options.js +2 -0
  22. package/dist/cjs/types/types.js +2 -0
  23. package/dist/{utils → cjs/utils}/ClientUtil.js +73 -84
  24. package/dist/{utils → cjs/utils}/CommandUtil.js +102 -103
  25. package/dist/{validators → cjs/validators}/CommandValidations.js +36 -50
  26. package/dist/{validators → cjs/validators}/InhibitorValidations.js +12 -14
  27. package/dist/mjs/build/ContextCommandBuilder.d.ts +68 -0
  28. package/dist/mjs/build/ContextCommandBuilder.js +97 -0
  29. package/dist/mjs/build/EventBuilder.d.ts +21 -0
  30. package/dist/mjs/build/EventBuilder.js +44 -0
  31. package/dist/mjs/build/InhibitorBuilder.d.ts +19 -0
  32. package/dist/mjs/build/InhibitorBuilder.js +37 -0
  33. package/dist/mjs/build/MessageCommandBuilder.d.ts +59 -0
  34. package/dist/mjs/build/MessageCommandBuilder.js +100 -0
  35. package/dist/mjs/build/SlashCommandBuilder.d.ts +65 -0
  36. package/dist/mjs/build/SlashCommandBuilder.js +169 -0
  37. package/dist/mjs/client/XernerxClient.d.ts +28 -0
  38. package/dist/mjs/client/XernerxClient.js +116 -0
  39. package/dist/mjs/handlers/CommandHandler.d.ts +27 -0
  40. package/dist/mjs/handlers/CommandHandler.js +45 -0
  41. package/dist/mjs/handlers/EventHandler.d.ts +13 -0
  42. package/dist/mjs/handlers/EventHandler.js +19 -0
  43. package/dist/mjs/handlers/Handler.d.ts +57 -0
  44. package/dist/mjs/handlers/Handler.js +308 -0
  45. package/dist/mjs/handlers/InhibitorHandler.d.ts +18 -0
  46. package/dist/mjs/handlers/InhibitorHandler.js +24 -0
  47. package/dist/{main.js → mjs/main.d.ts} +20 -18
  48. package/dist/mjs/main.js +112 -0
  49. package/dist/mjs/models/CommandArguments.d.ts +17 -0
  50. package/dist/mjs/models/CommandArguments.js +106 -0
  51. package/dist/mjs/models/Events.d.ts +24 -0
  52. package/dist/mjs/models/Events.js +307 -0
  53. package/dist/mjs/models/Extensions.d.ts +7 -0
  54. package/dist/mjs/models/Extensions.js +26 -0
  55. package/dist/mjs/tools/XernerxError.d.ts +5 -0
  56. package/dist/mjs/tools/XernerxError.js +11 -0
  57. package/dist/mjs/tools/package.d.ts +49 -0
  58. package/dist/mjs/tools/package.js +50 -0
  59. package/dist/mjs/types/enums.d.ts +44 -0
  60. package/dist/mjs/types/enums.js +38 -0
  61. package/dist/mjs/types/interfaces.d.ts +25 -0
  62. package/dist/mjs/types/interfaces.js +2 -0
  63. package/dist/mjs/types/options.d.ts +241 -0
  64. package/dist/mjs/types/options.js +2 -0
  65. package/dist/mjs/types/types.d.ts +61 -0
  66. package/dist/mjs/types/types.js +2 -0
  67. package/dist/mjs/utils/ClientUtil.d.ts +25 -0
  68. package/dist/mjs/utils/ClientUtil.js +211 -0
  69. package/dist/mjs/utils/CommandUtil.d.ts +58 -0
  70. package/dist/mjs/utils/CommandUtil.js +247 -0
  71. package/dist/mjs/validators/CommandValidations.d.ts +12 -0
  72. package/dist/mjs/validators/CommandValidations.js +169 -0
  73. package/dist/mjs/validators/InhibitorValidations.d.ts +11 -0
  74. package/dist/mjs/validators/InhibitorValidations.js +40 -0
  75. package/package.json +11 -16
  76. package/dist/build/ContextCommandBuilder.js +0 -93
  77. package/dist/build/EventBuilder.js +0 -34
  78. package/dist/build/InhibitorBuilder.js +0 -27
  79. package/dist/build/MessageCommandBuilder.js +0 -90
  80. package/dist/build/SlashCommandBuilder.js +0 -125
  81. package/dist/client/XernerxClient.js +0 -101
  82. package/dist/handlers/Handler.js +0 -250
  83. package/dist/main.cjs +0 -2012
  84. package/dist/models/Events.js +0 -294
  85. package/dist/models/Extensions.js +0 -23
  86. package/dist/tools/package.js +0 -37
  87. package/dist/types/enums.js +0 -35
  88. package/dist/types/interfaces.js +0 -1
  89. package/dist/types/options.js +0 -1
  90. package/dist/types/types.js +0 -1
  91. package/dist/validators/Shapes.js +0 -1
  92. package/types/validators/Shapes.d.ts +0 -1
  93. /package/{types → dist/cjs}/build/ContextCommandBuilder.d.ts +0 -0
  94. /package/{types → dist/cjs}/build/EventBuilder.d.ts +0 -0
  95. /package/{types → dist/cjs}/build/InhibitorBuilder.d.ts +0 -0
  96. /package/{types → dist/cjs}/build/MessageCommandBuilder.d.ts +0 -0
  97. /package/{types → dist/cjs}/client/XernerxClient.d.ts +0 -0
  98. /package/{types → dist/cjs}/handlers/CommandHandler.d.ts +0 -0
  99. /package/{types → dist/cjs}/handlers/EventHandler.d.ts +0 -0
  100. /package/{types → dist/cjs}/handlers/Handler.d.ts +0 -0
  101. /package/{types → dist/cjs}/handlers/InhibitorHandler.d.ts +0 -0
  102. /package/{types → dist/cjs}/main.d.ts +0 -0
  103. /package/{types → dist/cjs}/models/CommandArguments.d.ts +0 -0
  104. /package/{types → dist/cjs}/models/Events.d.ts +0 -0
  105. /package/{types → dist/cjs}/models/Extensions.d.ts +0 -0
  106. /package/{types → dist/cjs}/tools/XernerxError.d.ts +0 -0
  107. /package/{types → dist/cjs}/types/enums.d.ts +0 -0
  108. /package/{types → dist/cjs}/types/interfaces.d.ts +0 -0
  109. /package/{types → dist/cjs}/types/options.d.ts +0 -0
  110. /package/{types → dist/cjs}/types/types.d.ts +0 -0
  111. /package/{types → dist/cjs}/utils/ClientUtil.d.ts +0 -0
  112. /package/{types → dist/cjs}/utils/CommandUtil.d.ts +0 -0
  113. /package/{types → dist/cjs}/validators/CommandValidations.d.ts +0 -0
  114. /package/{types → dist/cjs}/validators/InhibitorValidations.d.ts +0 -0
@@ -0,0 +1,307 @@
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+ exports.CommandsDeploy = exports.ContextCommandEvents = exports.SlashCommandEvents = exports.MessageCommandEvents = void 0;
9
+ const discord_js_1 = require('discord.js');
10
+ const CommandUtil_js_1 = require('../utils/CommandUtil.js');
11
+ const CommandArguments_js_1 = require('./CommandArguments.js');
12
+ const CommandValidations_js_1 = __importDefault(require('../validators/CommandValidations.js'));
13
+ const dumfunctions_1 = require('dumfunctions');
14
+ const InhibitorValidations_js_1 = require('../validators/InhibitorValidations.js');
15
+ class MessageCommandEvents {
16
+ client;
17
+ constructor(client) {
18
+ this.client = client;
19
+ }
20
+ messageCreate() {
21
+ this.client.on('messageCreate', async (message) => {
22
+ if (!message.author.bot) {
23
+ let command = undefined,
24
+ px = undefined;
25
+ message.author.isOwner = this.client.util.isOwner(message.author.id);
26
+ message.util = new CommandUtil_js_1.MessageCommandUtil(this.client, message);
27
+ const commands = this.client.commands.message;
28
+ commands
29
+ .filter((c) => !c.regex)
30
+ .map(async (cmd) => {
31
+ if (cmd.prefix) {
32
+ cmd.prefix.map((prefix) => {
33
+ if (message.content.startsWith(prefix)) {
34
+ command = message.content.replace(prefix, '').split(/ +/).shift();
35
+ px = prefix;
36
+ }
37
+ });
38
+ }
39
+ if (this.client.handlerOptions.message?.prefix) {
40
+ const prefix = Array.isArray(this.client.handlerOptions.message.prefix) ? this.client.handlerOptions.message.prefix : [this.client.handlerOptions.message.prefix];
41
+ prefix.map((prefix) => {
42
+ if (message.content.startsWith(prefix)) {
43
+ command = message.content.replace(prefix, '').split(/ +/).shift();
44
+ px = prefix;
45
+ }
46
+ });
47
+ }
48
+ if (this.client.handlerOptions.message?.allowMention) {
49
+ if (message.mentions.users.has(this.client.user?.id) || message.mentions.repliedUser?.id === this.client.user?.id) {
50
+ command = message.content.replace(`<@${this.client.user?.id}>`, '').trim().split(/ +/).shift();
51
+ px = 'MentionPrefix';
52
+ }
53
+ }
54
+ const prefix = Array.isArray(this.client.handlerOptions.message?.prefix) ? this.client.handlerOptions.message?.prefix : [this.client.handlerOptions.message?.prefix];
55
+ if (
56
+ (cmd.name.toLowerCase() == command?.toLowerCase() || cmd.aliases?.map((c) => c.toLowerCase())?.includes(command?.toLowerCase())) &&
57
+ (cmd.prefix.includes(px) || prefix?.includes(px) || px === 'MentionPrefix')
58
+ ) {
59
+ try {
60
+ if (this.client.handlerOptions.message?.handleTyping) message.channel.sendTyping();
61
+ const inhibitor = new InhibitorValidations_js_1.InhibitorValidation(this.client, message, command);
62
+ if ((0, CommandValidations_js_1.default)(message, cmd, this.client)) return;
63
+ if (await inhibitor.inhibit()) return;
64
+ if (cmd.conditions && (await cmd.conditions(message, await (0, CommandArguments_js_1.messageArguments)(message, cmd)))) return;
65
+ await cmd.exec(message, await (0, CommandArguments_js_1.messageArguments)(message, cmd));
66
+ this.client.emit('commandRun', message, cmd);
67
+ } catch (error) {
68
+ return this.client.emit('commandError', message, error, cmd);
69
+ }
70
+ }
71
+ });
72
+ }
73
+ });
74
+ }
75
+ messageUpdate() {
76
+ this.client.on('messageUpdate', async (old, message) => {
77
+ message = message;
78
+ if (!message.author?.bot) {
79
+ let command = undefined,
80
+ px = undefined;
81
+ if (message.author) message.author.isOwner = this.client.util.isOwner(message.author.id);
82
+ message.util = new CommandUtil_js_1.MessageCommandUtil(this.client, message);
83
+ const commands = this.client.commands.message;
84
+ commands
85
+ .filter((c) => !c.regex)
86
+ .map(async (cmd) => {
87
+ if (cmd.prefix) {
88
+ cmd.prefix.map((prefix) => {
89
+ if (message?.content?.startsWith(prefix)) {
90
+ command = message.content.replace(prefix, '').split(/ +/).shift();
91
+ px = prefix;
92
+ }
93
+ });
94
+ }
95
+ if (this.client.handlerOptions.message?.prefix) {
96
+ const prefix = Array.isArray(this.client.handlerOptions.message.prefix) ? this.client.handlerOptions.message.prefix : [this.client.handlerOptions.message.prefix];
97
+ prefix.map((prefix) => {
98
+ if (message?.content?.startsWith(prefix)) {
99
+ command = message.content.replace(prefix, '').split(/ +/).shift();
100
+ px = prefix;
101
+ }
102
+ });
103
+ }
104
+ if (this.client.handlerOptions.message?.allowMention) {
105
+ if (message.mentions.users.has(this.client.user?.id || '') || message.mentions.repliedUser?.id === this.client.user?.id) {
106
+ command = message?.content?.replace(`<@${this.client.user?.id}>`, '').trim().split(/ +/).shift();
107
+ px = 'MentionPrefix';
108
+ }
109
+ }
110
+ const prefix = Array.isArray(this.client.handlerOptions.message?.prefix) ? this.client.handlerOptions.message?.prefix : [this.client.handlerOptions.message?.prefix];
111
+ if (
112
+ (cmd.name.toLowerCase() == command?.toLowerCase() || cmd.aliases?.map((c) => c.toLowerCase())?.includes(command?.toLowerCase())) &&
113
+ (cmd.prefix.includes(px) || prefix?.includes(px) || px === 'MentionPrefix')
114
+ ) {
115
+ try {
116
+ if (this.client.handlerOptions.message?.handleTyping) message.channel.sendTyping();
117
+ message = message;
118
+ const inhibitor = new InhibitorValidations_js_1.InhibitorValidation(this.client, message, command);
119
+ if ((0, CommandValidations_js_1.default)(message, cmd, this.client)) return;
120
+ if (await inhibitor.inhibit()) return;
121
+ if (cmd.conditions && (await cmd.conditions(message, await (0, CommandArguments_js_1.messageArguments)(message, cmd)))) return;
122
+ await cmd.exec(message, await (0, CommandArguments_js_1.messageArguments)(message, cmd));
123
+ this.client.emit('commandRun', message, cmd);
124
+ } catch (error) {
125
+ return this.client.emit('commandError', message, error, cmd);
126
+ }
127
+ }
128
+ });
129
+ }
130
+ });
131
+ }
132
+ messageDelete() {
133
+ this.client.on('messageDelete', async (message) => {
134
+ if (this.client.cache.messages.has(message.id) && this.client.handlerOptions.message?.handleDeletes) {
135
+ try {
136
+ if (this.client.handlerOptions.message?.handleTyping) message.channel.sendTyping();
137
+ const msg = this.client.cache.messages.get(message.id);
138
+ const response = await message.channel.messages.fetch(msg?.response);
139
+ await response.delete();
140
+ } catch (error) {
141
+ this.client.emit('commandError', message, error, null);
142
+ }
143
+ }
144
+ });
145
+ }
146
+ }
147
+ exports.MessageCommandEvents = MessageCommandEvents;
148
+ class SlashCommandEvents {
149
+ client;
150
+ constructor(client) {
151
+ this.client = client;
152
+ }
153
+ slashCreate() {
154
+ this.client.on('interactionCreate', async (interaction) => {
155
+ interaction.util = new CommandUtil_js_1.InteractionCommandUtil(this.client, interaction);
156
+ interaction.user.isOwner = this.client.util.isOwner(interaction.user.id);
157
+ if (interaction.type === discord_js_1.InteractionType.ApplicationCommand) {
158
+ if (this.client.commands.slash.has(interaction.commandName)) {
159
+ let command = this.client.commands.slash.get(interaction.commandName);
160
+ const argumentsInfo = new CommandArguments_js_1.InteractionArguments(interaction);
161
+ try {
162
+ const inhibitor = new InhibitorValidations_js_1.InhibitorValidation(this.client, interaction, command);
163
+ if (await inhibitor.inhibit()) return;
164
+ if ((0, CommandValidations_js_1.default)(interaction, command, this.client)) return;
165
+ if (command.defer?.reply !== false && this.client.handlerOptions.slash?.defer?.reply)
166
+ await interaction.deferReply({
167
+ ephemeral: this.client.handlerOptions.slash?.defer?.ephemeral,
168
+ fetchReply: this.client.handlerOptions.slash?.defer?.fetchReply,
169
+ });
170
+ if (!(interaction.deferred || interaction.replied) && command.defer?.reply)
171
+ await interaction.deferReply({
172
+ ephemeral: command.defer?.ephemeral,
173
+ fetchReply: command.defer?.fetchReply,
174
+ });
175
+ if (
176
+ command.conditions &&
177
+ (await command.conditions(interaction, {
178
+ group: argumentsInfo.group(),
179
+ subcommand: argumentsInfo.subcommand(),
180
+ args: await argumentsInfo.arguments(),
181
+ }))
182
+ )
183
+ return;
184
+ await command.exec(interaction, {
185
+ group: argumentsInfo.group(),
186
+ subcommand: argumentsInfo.subcommand(),
187
+ args: await argumentsInfo.arguments(),
188
+ });
189
+ this.client.emit('commandRun', interaction, command);
190
+ } catch (error) {
191
+ this.client.emit('commandError', interaction, error, command);
192
+ }
193
+ }
194
+ }
195
+ });
196
+ }
197
+ }
198
+ exports.SlashCommandEvents = SlashCommandEvents;
199
+ class ContextCommandEvents {
200
+ client;
201
+ constructor(client) {
202
+ this.client = client;
203
+ }
204
+ contextCreate() {
205
+ this.client.on('interactionCreate', async (interaction) => {
206
+ interaction.util = new CommandUtil_js_1.InteractionCommandUtil(this.client, interaction);
207
+ interaction.user.isOwner = this.client.util.isOwner(interaction.user.id);
208
+ if (interaction.type === discord_js_1.InteractionType.ApplicationCommand) {
209
+ if (this.client.commands.context.has(interaction.commandName)) {
210
+ let command = this.client.commands.context.get(interaction.commandName);
211
+ try {
212
+ const inhibitor = new InhibitorValidations_js_1.InhibitorValidation(this.client, interaction, command);
213
+ if ((0, CommandValidations_js_1.default)(interaction, command, this.client)) return;
214
+ if (await inhibitor.inhibit()) return;
215
+ if (command.conditions && (await command.conditions(interaction))) return;
216
+ if (command.defer?.reply !== false && this.client.handlerOptions.context?.defer?.reply)
217
+ await interaction.deferReply({
218
+ ephemeral: this.client.handlerOptions.context?.defer?.ephemeral,
219
+ fetchReply: this.client.handlerOptions.context?.defer?.fetchReply,
220
+ });
221
+ if (!(interaction.deferred || interaction.replied) && command.defer?.reply)
222
+ await interaction.deferReply({
223
+ ephemeral: command.defer?.ephemeral,
224
+ fetchReply: command.defer?.fetchReply,
225
+ });
226
+ let args = {};
227
+ if (command.type === 3) args = await interaction.channel.messages.fetch(interaction.targetId);
228
+ if (command.type === 2) args = await this.client.users.fetch(interaction.targetId);
229
+ await command.exec(interaction, args);
230
+ this.client.emit('commandRun', interaction, command);
231
+ } catch (error) {
232
+ this.client.emit('commandError', interaction, error, command);
233
+ }
234
+ }
235
+ }
236
+ });
237
+ }
238
+ }
239
+ exports.ContextCommandEvents = ContextCommandEvents;
240
+ class CommandsDeploy {
241
+ client;
242
+ constructor(client) {
243
+ this.client = client;
244
+ }
245
+ deploy() {
246
+ this.client.once('ready', async (client) => {
247
+ const slashCommands = [],
248
+ contextCommands = [];
249
+ this.client.commands.context.map((command) => (command.data ? contextCommands.push(command.data.toJSON()) : null));
250
+ this.client.commands.slash.map((command) => (command.data ? slashCommands.push(command.data.toJSON()) : null));
251
+ try {
252
+ const global = {
253
+ slash: this.client.handlerOptions.slash?.global,
254
+ context: this.client.handlerOptions.context?.global,
255
+ };
256
+ const guild = {
257
+ slash: this.client.handlerOptions.slash?.guildId,
258
+ context: this.client.handlerOptions.context?.guildId,
259
+ };
260
+ if (!guild.slash && !guild.context) return;
261
+ if (global.slash && global.context) {
262
+ if (guild.slash !== guild.context)
263
+ console.info(
264
+ dumfunctions_1.Style.log(
265
+ `Xernerx | Warning: slash and context commands are both set to global, but don't have a matching guildId, using ${
266
+ (await this.client.guilds.fetch(this.client.handlerOptions.slash?.guildId)).name
267
+ }!`,
268
+ { color: dumfunctions_1.Style.TextColor.Red }
269
+ )
270
+ );
271
+ this.put('global', guild.slash, [...contextCommands, ...slashCommands]);
272
+ this.put('guild', guild.slash, []);
273
+ }
274
+ if (global.slash && global.context === false) {
275
+ this.put('global', guild.slash, slashCommands);
276
+ }
277
+ if (global.slash === false && global.context) {
278
+ this.put('global', guild.context, contextCommands);
279
+ }
280
+ if (global.slash === false && global.context === false) {
281
+ this.put('guild', guild.slash, [...contextCommands, ...slashCommands]);
282
+ }
283
+ if (this.client.handlerOptions.context?.logging || this.client.handlerOptions.slash?.logging)
284
+ console.info(
285
+ dumfunctions_1.Style.log(
286
+ `Xernerx | Deployed ${slashCommands.length} slash commands ${global.slash ? 'globally' : 'locally'} and ${contextCommands.length} context commands ${
287
+ global.context ? 'globally' : 'locally'
288
+ }.`,
289
+ { color: dumfunctions_1.Style.TextColor.Purple }
290
+ )
291
+ );
292
+ } catch (error) {
293
+ console.error(
294
+ dumfunctions_1.Style.log(`Xernerx | Couldn't deploy interaction commands because <${error}>.`, {
295
+ color: dumfunctions_1.Style.BackgroundColor.Red,
296
+ })
297
+ );
298
+ }
299
+ });
300
+ }
301
+ put(type, guild, body) {
302
+ const rest = new discord_js_1.REST({ version: discord_js_1.GatewayVersion }).setToken(this.client.token);
303
+ if (type === 'guild') rest.put(discord_js_1.Routes.applicationGuildCommands(this.client.user?.id, guild), { body });
304
+ else rest.put(discord_js_1.Routes.applicationCommands(this.client.user?.id), { body });
305
+ }
306
+ }
307
+ exports.CommandsDeploy = CommandsDeploy;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ const dumfunctions_1 = require('dumfunctions');
4
+ class Extensions {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ async load(extensions, logging = false) {
10
+ const exts = [];
11
+ extensions.map((extension) => {
12
+ try {
13
+ this.client.extensions[extension.name] = extension;
14
+ exts.push(extension.name);
15
+ } catch (error) {
16
+ console.error(
17
+ dumfunctions_1.Style.log(`Xernerx | An error occurred trying to load ${extension.name}, error: <${error}>`, {
18
+ color: dumfunctions_1.Style.BackgroundColor.Red,
19
+ })
20
+ );
21
+ }
22
+ });
23
+ if (logging) console.info(dumfunctions_1.Style.log(`Xernerx | Loaded ${exts.length} extensions: ${exts.join(', ')}`, { color: dumfunctions_1.Style.TextColor.Cyan }));
24
+ }
25
+ }
26
+ exports.default = Extensions;
@@ -1,4 +1,6 @@
1
- export default class XernerxError {
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ class XernerxError {
2
4
  name;
3
5
  message;
4
6
  constructor(message) {
@@ -6,3 +8,4 @@ export default class XernerxError {
6
8
  this.message = message || '';
7
9
  }
8
10
  }
11
+ exports.default = XernerxError;
@@ -9,6 +9,13 @@ declare const _default: {
9
9
  license: string;
10
10
  homepage: string;
11
11
  packageManager: string;
12
+ exports: {
13
+ import: string;
14
+ require: string;
15
+ types: string;
16
+ node: null;
17
+ default: null;
18
+ };
12
19
  scripts: {
13
20
  start: string;
14
21
  patch: string;
@@ -16,6 +23,7 @@ declare const _default: {
16
23
  major: string;
17
24
  site: string;
18
25
  commit: string;
26
+ write: string;
19
27
  build: string;
20
28
  };
21
29
  repository: {
@@ -30,8 +38,11 @@ declare const _default: {
30
38
  'discord.js': string;
31
39
  dumfunctions: string;
32
40
  'xernerx-extension-builder': string;
41
+ zod: string;
33
42
  };
34
43
  devDependencies: {
44
+ prettier: string;
45
+ tsup: string;
35
46
  typescript: string;
36
47
  };
37
48
  };
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.default = {
4
+ name: 'xernerx',
5
+ version: '3.5.1',
6
+ type: 'module',
7
+ description: 'A bot framework for discord.js.',
8
+ main: 'dist/main.js',
9
+ keywords: ['discord.js', 'discord', 'framework', 'mjs', 'esm', 'cjs', 'ts'],
10
+ author: 'Dummi',
11
+ license: 'MIT',
12
+ homepage: 'https://xernerx.github.io/xernerx/home.html',
13
+ packageManager: 'npm@8.5.5',
14
+ exports: {
15
+ import: './dist/main.js',
16
+ require: './dist/main.cjs',
17
+ types: './types',
18
+ node: null,
19
+ default: null,
20
+ },
21
+ scripts: {
22
+ start: 'npm i && npm fund && npm audit fix --force && npm link && tsc -w',
23
+ patch: 'npm run write && git add . && npm run commit && npm version patch && npm publish && git push',
24
+ minor: 'npm run write && git add . && npm run commit && npm version minor && npm publish && git push',
25
+ major: 'npm run write && git add . && npm run commit && npm version major && npm publish && git push',
26
+ site: 'git add docs && npm run commit && git push',
27
+ commit: 'node ../.scripts/commit.js',
28
+ write: 'npm run build && node ../.scripts/rewritePackage.js ',
29
+ build: 'tsc && npx tsup src/main.ts && npx prettier --write src',
30
+ },
31
+ repository: {
32
+ type: 'git',
33
+ url: 'git+https://github.com/xernerx/xernerx.git',
34
+ },
35
+ bugs: {
36
+ url: 'https://github.com/xernerx/xernerx/issues',
37
+ },
38
+ dependencies: {
39
+ '@sapphire/shapeshift': '^3.8.1',
40
+ 'discord.js': '^14.7.1',
41
+ dumfunctions: '^2.1.1',
42
+ 'xernerx-extension-builder': '^0.0.5',
43
+ zod: '^3.20.6',
44
+ },
45
+ devDependencies: {
46
+ prettier: '^2.8.4',
47
+ tsup: '^6.6.0',
48
+ typescript: '^4.9.5',
49
+ },
50
+ };
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.EventEmitterType = exports.ContextCommandType = exports.CommandType = exports.InhibitorType = void 0;
4
+ var InhibitorType;
5
+ (function (InhibitorType) {
6
+ InhibitorType['Member'] = 'Member';
7
+ InhibitorType['User'] = 'User';
8
+ InhibitorType['Guild'] = 'Guild';
9
+ InhibitorType['SlashCommand'] = 'SlashCommand';
10
+ InhibitorType['MessageCommand'] = 'MessageCommand';
11
+ InhibitorType['ContextCommand'] = 'ContextCommand';
12
+ InhibitorType['Command'] = 'Command';
13
+ InhibitorType['Message'] = 'Message';
14
+ InhibitorType['Interaction'] = 'Interaction';
15
+ InhibitorType['Channel'] = 'Channel';
16
+ })((InhibitorType = exports.InhibitorType || (exports.InhibitorType = {})));
17
+ var CommandType;
18
+ (function (CommandType) {
19
+ CommandType['Message'] = 'MessageCommand';
20
+ CommandType['Slash'] = 'SlashCommand';
21
+ CommandType['Context'] = 'ContextCommand';
22
+ CommandType['Event'] = 'Event';
23
+ CommandType['Inhibitor'] = 'Inhibitor';
24
+ CommandType['MessageCommand'] = 'MessageCommand';
25
+ CommandType['SlashCommand'] = 'SlashCommand';
26
+ CommandType['ContextCommand'] = 'ContextCommand';
27
+ })((CommandType = exports.CommandType || (exports.CommandType = {})));
28
+ var ContextCommandType;
29
+ (function (ContextCommandType) {
30
+ ContextCommandType[(ContextCommandType['Message'] = 3)] = 'Message';
31
+ ContextCommandType[(ContextCommandType['User'] = 2)] = 'User';
32
+ })((ContextCommandType = exports.ContextCommandType || (exports.ContextCommandType = {})));
33
+ var EventEmitterType;
34
+ (function (EventEmitterType) {
35
+ EventEmitterType['Client'] = 'client';
36
+ EventEmitterType['Rest'] = 'rest';
37
+ EventEmitterType['Process'] = 'process';
38
+ })((EventEmitterType = exports.EventEmitterType || (exports.EventEmitterType = {})));
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });