xernerx 3.3.7 → 3.4.0

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 (50) hide show
  1. package/dist/build/ContextCommandBuilder.d.ts +3 -1
  2. package/dist/build/ContextCommandBuilder.js +5 -1
  3. package/dist/build/EventBuilder.d.ts +1 -1
  4. package/dist/build/EventBuilder.js +1 -1
  5. package/dist/build/InhibitorBuilder.d.ts +2 -1
  6. package/dist/build/InhibitorBuilder.js +1 -1
  7. package/dist/build/MessageCommandBuilder.d.ts +1 -1
  8. package/dist/build/MessageCommandBuilder.js +1 -1
  9. package/dist/build/SlashCommandBuilder.d.ts +6 -2
  10. package/dist/build/SlashCommandBuilder.js +20 -12
  11. package/dist/build/XContextCommandBuilder.d.ts +40 -0
  12. package/dist/build/XContextCommandBuilder.js +84 -0
  13. package/dist/build/XEventBuilder.d.ts +17 -0
  14. package/dist/build/XEventBuilder.js +35 -0
  15. package/dist/build/XInhibitorBuilder.d.ts +20 -0
  16. package/dist/build/XInhibitorBuilder.js +28 -0
  17. package/dist/build/XMessageCommandBuilder.d.ts +42 -0
  18. package/dist/build/XMessageCommandBuilder.js +80 -0
  19. package/dist/build/XSlashCommandBuilder.d.ts +36 -0
  20. package/dist/build/XSlashCommandBuilder.js +114 -0
  21. package/dist/client/XernerxClient.d.ts +1 -1
  22. package/dist/client/XernerxClient.js +1 -2
  23. package/dist/handlers/CommandHandler.d.ts +4 -5
  24. package/dist/handlers/CommandHandler.js +2 -2
  25. package/dist/handlers/EventHandler.d.ts +4 -5
  26. package/dist/handlers/EventHandler.js +1 -1
  27. package/dist/handlers/Handler.d.ts +25 -6
  28. package/dist/handlers/Handler.js +41 -36
  29. package/dist/handlers/InhibitorHandler.d.ts +2 -3
  30. package/dist/main.d.ts +5 -71
  31. package/dist/main.js +6 -11
  32. package/dist/models/CommandArguments.d.ts +2 -2
  33. package/dist/models/CommandArguments.js +4 -2
  34. package/dist/models/Events.d.ts +5 -5
  35. package/dist/models/Events.js +69 -24
  36. package/dist/models/Extensions.d.ts +4 -3
  37. package/dist/models/Extensions.js +5 -3
  38. package/dist/tools/package.d.ts +3 -3
  39. package/dist/tools/package.js +31 -35
  40. package/dist/types/enums.js +4 -4
  41. package/dist/types/options.d.ts +3 -2
  42. package/dist/utils/ClientUtil.d.ts +1 -1
  43. package/dist/utils/ClientUtil.js +0 -11
  44. package/dist/utils/CommandUtil.d.ts +12 -6
  45. package/dist/utils/CommandUtil.js +26 -14
  46. package/dist/validators/CommandValidations.d.ts +7 -0
  47. package/dist/validators/CommandValidations.js +185 -0
  48. package/dist/validators/InhibitorValidations.d.ts +11 -0
  49. package/dist/validators/InhibitorValidations.js +42 -0
  50. package/package.json +1 -1
@@ -0,0 +1,114 @@
1
+ import Discord, { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, } from 'discord.js';
2
+ import { s } from '@sapphire/shapeshift';
3
+ import XernerxError from '../tools/XernerxError.js';
4
+ import XernerxClient from '../client/XernerxClient.js';
5
+ /**
6
+ * @description - The command builder for slash commands.
7
+ * @param {String} id - The unique ID of the command.
8
+ * @param {SlashCommandOptions} options - The command options.
9
+ */
10
+ export default class SlashCommandBuilder {
11
+ id;
12
+ data;
13
+ info;
14
+ category;
15
+ owner;
16
+ channelType;
17
+ separator;
18
+ cooldown;
19
+ ignoreOwner;
20
+ channels;
21
+ guilds;
22
+ userPermissions;
23
+ clientPermissions;
24
+ args;
25
+ subcommands;
26
+ groups;
27
+ defer;
28
+ client;
29
+ constructor(id, options) {
30
+ this.id = id;
31
+ this.data = new Discord.SlashCommandBuilder().setName(options.name).setDescription(options.description);
32
+ if (options.args && options?.args?.length > 0) {
33
+ this.#addArgs(this.data, options.args);
34
+ }
35
+ if (options.subcommands && options?.subcommands?.length > 0) {
36
+ this.#addSubcommands(this.data, options.subcommands);
37
+ }
38
+ if (options.groups && options?.groups?.length > 0) {
39
+ this.#addSubcommandGroups(options.groups);
40
+ }
41
+ s.object({
42
+ info: s.string.optional,
43
+ category: s.string.optional,
44
+ owner: s.boolean.optional,
45
+ channelType: s.union(s.number, s.array(s.number)).optional,
46
+ separator: s.string.optional,
47
+ cooldown: s.number.optional,
48
+ ignoreOwner: s.boolean.optional,
49
+ channels: s.array(s.string).optional,
50
+ guilds: s.array(s.string).optional,
51
+ userPermissions: s.array(s.bigint).optional,
52
+ clientPermissions: s.array(s.bigint).optional,
53
+ defer: s.object({
54
+ reply: s.boolean.optional,
55
+ ephemeral: s.boolean.optional,
56
+ fetchReply: s.boolean.optional,
57
+ }).optional,
58
+ });
59
+ this.info = options.info;
60
+ this.category = options.category;
61
+ this.owner = options.owner;
62
+ this.channelType = options.channelType;
63
+ this.separator = options.separator;
64
+ this.cooldown = options.cooldown;
65
+ this.ignoreOwner = options.ignoreOwner;
66
+ this.channels = options.channels;
67
+ this.guilds = options.guilds;
68
+ this.userPermissions = options.userPermissions;
69
+ this.clientPermissions = options.clientPermissions;
70
+ this.defer = options.defer;
71
+ this.client = XernerxClient;
72
+ this.conditions = this.conditions;
73
+ this.exec = this.exec;
74
+ }
75
+ async conditions(interaction) { }
76
+ async exec(interaction) { }
77
+ #addArgs(command, args) {
78
+ const types = ['boolean', 'integer', 'number', 'string', 'user', 'role', 'channel', 'mentionable'];
79
+ for (const argument of args) {
80
+ if (!types.includes(argument.type.toLowerCase()))
81
+ throw new XernerxError(`Expected one of ${types.join(', ')}, received ${argument.type} instead.`);
82
+ let slashArgumentType = `${argument.type.slice(0, 1).toUpperCase()}${argument.type
83
+ .slice(1)
84
+ .toLowerCase()}`;
85
+ command[`add${slashArgumentType}Option`]((option) => {
86
+ option
87
+ .setName(argument.name)
88
+ .setDescription(argument.description)
89
+ .setRequired(argument.required || false);
90
+ if (argument.choices)
91
+ option.setChoices(...argument?.choices);
92
+ return option;
93
+ });
94
+ }
95
+ }
96
+ #addSubcommands(method, subcommands) {
97
+ for (const subcommand of subcommands) {
98
+ let sub = new SlashCommandSubcommandBuilder().setName(subcommand.name).setDescription(subcommand.description);
99
+ if (subcommand.args?.length > 0)
100
+ this.#addArgs(sub, subcommand.args);
101
+ method.addSubcommand(sub);
102
+ }
103
+ }
104
+ #addSubcommandGroups(groups) {
105
+ for (const group of groups) {
106
+ let subcommandGroup = new SlashCommandSubcommandGroupBuilder()
107
+ .setName(group.name)
108
+ .setDescription(group.description);
109
+ if (group.subcommands?.length > 0)
110
+ this.#addSubcommands(subcommandGroup, group.subcommands);
111
+ this.data.addSubcommandGroup(subcommandGroup);
112
+ }
113
+ }
114
+ }
@@ -24,5 +24,5 @@ export default class XernerxClient extends Client {
24
24
  config: object;
25
25
  constructor(discordOptions: DiscordOptions, clientOptions: ClientOptions, config?: object);
26
26
  register(token: string): void;
27
- loadExtensions(options: ExtensionOptions): Promise<void>;
27
+ loadAllExtensions(options: ExtensionOptions): Promise<void>;
28
28
  }
@@ -70,12 +70,11 @@ export default class XernerxClient extends Client {
70
70
  : ''}`, { color: Style.TextColor.Purple }));
71
71
  });
72
72
  }
73
- this.register = this.register;
74
73
  }
75
74
  register(token) {
76
75
  this.login(token);
77
76
  }
78
- loadExtensions(options) {
77
+ loadAllExtensions(options) {
79
78
  const extensions = new Extensions(this);
80
79
  return extensions.load(options.extensions, options.logging || false);
81
80
  }
@@ -1,13 +1,12 @@
1
- import XernerxClient from "../client/XernerxClient.js";
2
- import { Handler } from "./Handler.js";
3
- import { ContextCommandHandlerOptions, MessageCommandHandlerOptions, SlashCommandHandlerOptions } from "../types/options.js";
1
+ import XernerxClient from '../client/XernerxClient.js';
2
+ import { ContextCommandHandlerOptions, MessageCommandHandlerOptions, SlashCommandHandlerOptions } from '../types/options.js';
4
3
  /**
5
4
  * @description - The command handler.
6
5
  * @param {XernerxClient} client - The XernerxClient.
7
6
  */
8
7
  export default class CommandHandler {
9
- client: XernerxClient;
10
- handler: Handler;
8
+ private client;
9
+ private handler;
11
10
  constructor(client: XernerxClient);
12
11
  /**
13
12
  * @description - The message command loader.
@@ -1,5 +1,5 @@
1
- import { Handler } from "./Handler.js";
2
- import { CommandsDeploy, ContextCommandEvents, MessageCommandEvents, SlashCommandEvents, } from "../models/Events.js";
1
+ import { Handler } from './Handler.js';
2
+ import { CommandsDeploy, ContextCommandEvents, MessageCommandEvents, SlashCommandEvents } from '../models/Events.js';
3
3
  /**
4
4
  * @description - The command handler.
5
5
  * @param {XernerxClient} client - The XernerxClient.
@@ -1,9 +1,8 @@
1
- import XernerxClient from "../client/XernerxClient.js";
2
- import { EventHandlerOptions } from "../types/options.js";
3
- import { Handler } from "./Handler.js";
1
+ import XernerxClient from '../client/XernerxClient.js';
2
+ import { EventHandlerOptions } from '../types/options.js';
4
3
  export default class EventHandler {
5
- client: XernerxClient;
6
- handler: Handler;
4
+ private client;
5
+ private handler;
7
6
  constructor(client: XernerxClient);
8
7
  /**
9
8
  * @description - The event loader
@@ -1,4 +1,4 @@
1
- import { Handler } from "./Handler.js";
1
+ import { Handler } from './Handler.js';
2
2
  export default class EventHandler {
3
3
  client;
4
4
  handler;
@@ -1,14 +1,13 @@
1
- import XernerxClient from "../client/XernerxClient.js";
2
- import { ContextCommandHandlerOptions, EventHandlerOptions, InhibitorHandlerOptions, MessageCommandHandlerOptions, SlashCommandHandlerOptions } from "../types/options.js";
1
+ import XernerxClient from '../client/XernerxClient.js';
2
+ import { ContextCommandHandlerOptions, EventHandlerOptions, InhibitorHandlerOptions, MessageCommandHandlerOptions, SlashCommandHandlerOptions } from '../types/options.js';
3
3
  /**
4
4
  * @description - The Handler class.
5
5
  * @param {XernerxClient} client - The XernerxClient.
6
6
  */
7
7
  export declare class Handler {
8
- #private;
9
- client: XernerxClient;
10
- commands: object[];
11
- readyTimestamp: number;
8
+ private client;
9
+ private commands;
10
+ private readyTimestamp;
12
11
  constructor(client: XernerxClient);
13
12
  /**
14
13
  * @description - The loader for the message commands.
@@ -35,4 +34,24 @@ export declare class Handler {
35
34
  * @param {InhibitorLoadOptions} options - The options for the inhibitor loader.
36
35
  */
37
36
  loadAllInhibitors(options: InhibitorHandlerOptions): void;
37
+ /**
38
+ * @description - a reader for directories
39
+ * @param {string} dir - the directory to look for.
40
+ * @returns array of files.
41
+ */
42
+ private readdir;
43
+ /**
44
+ * @description file loader.
45
+ * @param {string} dir - the directory.
46
+ * @param {string} file - the file in the directory.
47
+ * @param {string} type - the type of file.
48
+ * @returns undefined
49
+ */
50
+ private load;
51
+ /**
52
+ * @description the event emitter to emit all events.
53
+ * @param {object} event - the event to be emitted.
54
+ * @returns void
55
+ */
56
+ private emitter;
38
57
  }
@@ -1,7 +1,7 @@
1
- import fs from "node:fs";
2
- import * as path from "path";
3
- import { CommandType } from "../types/enums.js";
4
- import { s } from "@sapphire/shapeshift";
1
+ import fs from 'node:fs';
2
+ import * as path from 'path';
3
+ import { CommandType } from '../types/enums.js';
4
+ import { s } from '@sapphire/shapeshift';
5
5
  import { Style } from 'dumfunctions';
6
6
  /**
7
7
  * @description - The Handler class.
@@ -35,13 +35,15 @@ export class Handler {
35
35
  logging: s.boolean.default(false),
36
36
  })
37
37
  .parse(options);
38
- const files = this.#readdir(options.directory), loaded = [];
38
+ const files = this.readdir(options.directory), loaded = [];
39
39
  for (const file of files) {
40
- this.#load(options.directory, file, CommandType.MessageCommand);
41
- loaded.push(file.replace(".js", ""));
40
+ this.load(options.directory, file, CommandType.MessageCommand);
41
+ loaded.push(file.replace('.js', ''));
42
42
  }
43
43
  if (this.client.handlerOptions.message?.logging)
44
- console.info(Style.log(`Xernerx | Loaded ${loaded.length} message commands: ${loaded.join(", ")}.`, { color: Style.TextColor.Cyan }));
44
+ console.info(Style.log(`Xernerx | Loaded ${loaded.length} message commands: ${loaded.join(', ')}.`, {
45
+ color: Style.TextColor.Cyan,
46
+ }));
45
47
  }
46
48
  /**
47
49
  * @description - The loader for the slash commands.
@@ -64,13 +66,15 @@ export class Handler {
64
66
  }).optional,
65
67
  })
66
68
  .parse(options);
67
- const files = this.#readdir(options.directory), loaded = [];
69
+ const files = this.readdir(options.directory), loaded = [];
68
70
  for (const file of files) {
69
- this.#load(options.directory, file, CommandType.SlashCommand);
70
- loaded.push(file.replace(".js", ""));
71
+ this.load(options.directory, file, CommandType.SlashCommand);
72
+ loaded.push(file.replace('.js', ''));
71
73
  }
72
74
  if (this.client.handlerOptions.slash?.logging)
73
- console.info(Style.log(`Xernerx | Loaded ${loaded.length} slash commands: ${loaded.join(", ")}.`, { color: Style.TextColor.Cyan }));
75
+ console.info(Style.log(`Xernerx | Loaded ${loaded.length} slash commands: ${loaded.join(', ')}.`, {
76
+ color: Style.TextColor.Cyan,
77
+ }));
74
78
  }
75
79
  /**
76
80
  * @description - The loader for the context commands.
@@ -93,13 +97,15 @@ export class Handler {
93
97
  }).optional,
94
98
  })
95
99
  .parse(options);
96
- const files = this.#readdir(options.directory), loaded = [];
100
+ const files = this.readdir(options.directory), loaded = [];
97
101
  for (const file of files) {
98
- this.#load(options.directory, file, CommandType.ContextCommand);
99
- loaded.push(file.replace(".js", ""));
102
+ this.load(options.directory, file, CommandType.ContextCommand);
103
+ loaded.push(file.replace('.js', ''));
100
104
  }
101
105
  if (this.client.handlerOptions.context?.logging)
102
- console.info(Style.log(`Xernerx | Loaded ${loaded.length} context commands: ${loaded.join(", ")}.`, { color: Style.TextColor.Cyan }));
106
+ console.info(Style.log(`Xernerx | Loaded ${loaded.length} context commands: ${loaded.join(', ')}.`, {
107
+ color: Style.TextColor.Cyan,
108
+ }));
103
109
  }
104
110
  /**
105
111
  * @description - The loader for the events.
@@ -112,25 +118,25 @@ export class Handler {
112
118
  logging: s.boolean.default(false),
113
119
  })
114
120
  .parse(options);
115
- const files = this.#readdir(options.directory), loaded = [];
121
+ const files = this.readdir(options.directory), loaded = [];
116
122
  (async () => {
117
123
  for (const file of files) {
118
124
  try {
119
125
  options.directory.split(/\//).shift();
120
- let event = (await import("file://" + `${path.resolve(options.directory)}/${file}`)).default;
126
+ let event = (await import('file://' + `${path.resolve(options.directory)}/${file}`)).default;
121
127
  event = new event();
122
128
  event.client = this.client;
123
129
  event.commandType = CommandType.Event;
124
130
  this.client.events.set(event.name, event);
125
- this.#emitter(event);
131
+ this.emitter(event);
126
132
  }
127
133
  catch (error) {
128
134
  console.error(Style.log(`Xernerx | Couldn't load ${file} because <${error}>`, { color: Style.BackgroundColor.Red }));
129
135
  }
130
- loaded.push(file.replace(".js", ""));
136
+ loaded.push(file.replace('.js', ''));
131
137
  }
132
138
  if (this.client.handlerOptions.events?.logging)
133
- console.info(Style.log(`Xernerx | Loaded ${loaded.length} events: ${loaded.join(", ")}.`, { color: Style.TextColor.Cyan }));
139
+ console.info(Style.log(`Xernerx | Loaded ${loaded.length} events: ${loaded.join(', ')}.`, { color: Style.TextColor.Cyan }));
134
140
  })();
135
141
  }
136
142
  /**
@@ -144,24 +150,24 @@ export class Handler {
144
150
  logging: s.boolean.default(false),
145
151
  })
146
152
  .parse(options);
147
- const files = this.#readdir(options.directory), loaded = [];
153
+ const files = this.readdir(options.directory), loaded = [];
148
154
  for (const file of files) {
149
- this.#load(options.directory, file, CommandType.Inhibitor);
150
- loaded.push(file.replace(".js", ""));
155
+ this.load(options.directory, file, CommandType.Inhibitor);
156
+ loaded.push(file.replace('.js', ''));
151
157
  }
152
158
  if (this.client.handlerOptions.inhibitors?.logging)
153
- console.info(Style.log(`Xernerx | Loaded ${loaded.length} inhibitors: ${loaded.join(", ")}.`, { color: Style.TextColor.Cyan }));
159
+ console.info(Style.log(`Xernerx | Loaded ${loaded.length} inhibitors: ${loaded.join(', ')}.`, {
160
+ color: Style.TextColor.Cyan,
161
+ }));
154
162
  }
155
163
  /**
156
164
  * @description - a reader for directories
157
165
  * @param {string} dir - the directory to look for.
158
166
  * @returns array of files.
159
167
  */
160
- #readdir(dir) {
168
+ readdir(dir) {
161
169
  try {
162
- return fs
163
- .readdirSync(path.resolve(dir))
164
- .filter((file) => file.endsWith(".js"));
170
+ return fs.readdirSync(path.resolve(dir)).filter((file) => file.endsWith('.js'));
165
171
  }
166
172
  catch (error) {
167
173
  console.error(Style.log(`Xernerx | Couldn't read ${dir} because <${error}>.`, { color: Style.BackgroundColor.Red }));
@@ -175,11 +181,10 @@ export class Handler {
175
181
  * @param {string} type - the type of file.
176
182
  * @returns undefined
177
183
  */
178
- async #load(dir, file, type) {
184
+ async load(dir, file, type) {
179
185
  try {
180
186
  dir.split(/\//).shift();
181
- let command = (await import("file://" + `${path.resolve(dir)}/${file}`))
182
- .default;
187
+ let command = (await import('file://' + `${path.resolve(dir)}/${file}`)).default;
183
188
  command = new command();
184
189
  command.client = this.client;
185
190
  command.commandType = type;
@@ -209,9 +214,9 @@ export class Handler {
209
214
  * @param {object} event - the event to be emitted.
210
215
  * @returns void
211
216
  */
212
- #emitter(event) {
217
+ emitter(event) {
213
218
  const client = this.client;
214
- if (event.emitter === "client") {
219
+ if (event.emitter === 'client') {
215
220
  if (event.once)
216
221
  client.once(event.name, (...args) => {
217
222
  event.run(...args);
@@ -221,7 +226,7 @@ export class Handler {
221
226
  event.run(...args);
222
227
  });
223
228
  }
224
- else if (event.emitter === "rest") {
229
+ else if (event.emitter === 'rest') {
225
230
  if (event.once)
226
231
  client.once(event.name, (...args) => {
227
232
  event.run(...args);
@@ -231,7 +236,7 @@ export class Handler {
231
236
  event.run(...args);
232
237
  });
233
238
  }
234
- else if (event.emitter === "process") {
239
+ else if (event.emitter === 'process') {
235
240
  if (event.once)
236
241
  process.once(event.name, (...args) => {
237
242
  event.run(...args);
@@ -1,13 +1,12 @@
1
1
  import XernerxClient from '../client/XernerxClient.js';
2
2
  import { InhibitorHandlerOptions } from '../types/options.js';
3
- import { Handler } from './Handler.js';
4
3
  /**
5
4
  * @description - Inhibitor loader.
6
5
  * @param {XernerxClient} client - The XernerxClient.
7
6
  */
8
7
  export default class InhibitorHandler {
9
- client: XernerxClient;
10
- handler: Handler;
8
+ private client;
9
+ private handler;
11
10
  constructor(client: XernerxClient);
12
11
  /**
13
12
  * @description - The loader for all inhibitors.
package/dist/main.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import Discord from 'discord.js';
2
- import DumFunctions from 'dumfunctions';
1
+ export * from 'discord.js';
2
+ export * from 'dumfunctions';
3
+ import ExtensionBuilder from 'xernerx-extension-builder';
3
4
  import XernerxClient from './client/XernerxClient.js';
4
5
  import EventBuilder from './build/EventBuilder.js';
5
6
  import InhibitorBuilder from './build/InhibitorBuilder.js';
@@ -8,75 +9,8 @@ import ContextCommandBuilder from './build/ContextCommandBuilder.js';
8
9
  import SlashCommandBuilder from './build/SlashCommandBuilder.js';
9
10
  import { CommandType, EventEmitterType, ContextCommandType, InhibitorType } from './types/enums.js';
10
11
  import XernerxError from './tools/XernerxError.js';
11
- import ExtensionBuilder from 'xernerx-extension-builder';
12
- declare const version: string;
12
+ declare const xernerxVersion: string;
13
13
  declare const _default: {
14
- Discord: typeof Discord;
15
- DumFunctions: {
16
- Math: {
17
- E: number;
18
- LN10: number;
19
- LN2: number;
20
- LOG10E: number;
21
- LOG2E: number;
22
- PI: number;
23
- SQRT1_2: number;
24
- SQRT2: number;
25
- abs(number: number): number;
26
- acos(number: number): number;
27
- acosh(number: number): number;
28
- asin(number: number): number;
29
- asinh(number: number): number;
30
- atan(number: number): number;
31
- atan2(x: number, y: number): number;
32
- atanh(number: number): number;
33
- cbrt(number: number): number;
34
- ceil(number: number): number;
35
- clz32(number: number): number;
36
- cos(number: number): number;
37
- cosh(number: number): number;
38
- dif(...numbers: number[]): number;
39
- exp(number: number): number;
40
- expm1(number: number): number;
41
- floor(number: number): number;
42
- fround(number: number): number;
43
- hypot(number: number): number;
44
- imul(x: number, y: number): number;
45
- log(number: number): number;
46
- log10(number: number): number;
47
- log1p(number: number): number;
48
- log2(number: number): number;
49
- max(...numbers: number[]): number;
50
- min(...numbers: number[]): number;
51
- pow(x: number, y: number): number;
52
- random(x?: number | undefined, y?: number | undefined): number;
53
- round(number: number): number;
54
- shuffle(...numbers: number[]): number | number[];
55
- sign(number: number): number;
56
- sin(number: number): number;
57
- sinh(number: number): number;
58
- sum(...numbers: number[]): number;
59
- sqrt(number: number): number;
60
- tan(number: number): number;
61
- tanh(number: number): number;
62
- trunc(number: number): number;
63
- };
64
- Random: {
65
- number(min: number, max: number): number;
66
- element(array: object | unknown[]): any;
67
- "__#1916@#color"(): void;
68
- };
69
- Style: {
70
- TextStyle: typeof import("dumfunctions/dist/models/Style.js").TextStyle;
71
- TextColor: typeof import("dumfunctions/dist/models/Style.js").TextColor;
72
- BackgroundColor: typeof import("dumfunctions/dist/models/Style.js").BackgroundColor;
73
- titleCase(string: string, lowercase?: boolean | undefined): string;
74
- pascalCase(string: string, lowercase?: boolean | undefined): string;
75
- stringCase(string: string, lowercase?: boolean | undefined): string;
76
- phraseCase(string: string, lowercase?: boolean | undefined): string;
77
- log(text: string, options: import("dumfunctions/dist/models/Style.js").LogOptions): string;
78
- };
79
- };
80
14
  Client: typeof XernerxClient;
81
15
  XernerxClient: typeof XernerxClient;
82
16
  CommandType: typeof CommandType;
@@ -93,4 +27,4 @@ declare const _default: {
93
27
  version: string;
94
28
  };
95
29
  export default _default;
96
- export { Discord, DumFunctions, XernerxClient, CommandType, EventEmitterType, InhibitorType, ContextCommandType, EventBuilder, MessageCommandBuilder, ContextCommandBuilder, SlashCommandBuilder, InhibitorBuilder, ExtensionBuilder, XernerxError, version, };
30
+ export { XernerxClient, CommandType, EventEmitterType, InhibitorType, ContextCommandType, EventBuilder, MessageCommandBuilder, ContextCommandBuilder, SlashCommandBuilder, InhibitorBuilder, ExtensionBuilder, XernerxError, xernerxVersion, };
package/dist/main.js CHANGED
@@ -1,5 +1,6 @@
1
- import Discord from 'discord.js';
2
- import DumFunctions from 'dumfunctions';
1
+ export * from 'discord.js';
2
+ export * from 'dumfunctions';
3
+ import ExtensionBuilder from 'xernerx-extension-builder';
3
4
  import XernerxClient from './client/XernerxClient.js';
4
5
  import EventBuilder from './build/EventBuilder.js';
5
6
  import InhibitorBuilder from './build/InhibitorBuilder.js';
@@ -8,13 +9,9 @@ import ContextCommandBuilder from './build/ContextCommandBuilder.js';
8
9
  import SlashCommandBuilder from './build/SlashCommandBuilder.js';
9
10
  import { CommandType, EventEmitterType, ContextCommandType, InhibitorType } from './types/enums.js';
10
11
  import XernerxError from './tools/XernerxError.js';
11
- import ExtensionBuilder from 'xernerx-extension-builder';
12
12
  import pkg from './tools/package.js';
13
- const version = pkg.version;
13
+ const xernerxVersion = pkg.version;
14
14
  export default {
15
- // Imported methods
16
- Discord,
17
- DumFunctions,
18
15
  // Client
19
16
  Client: XernerxClient,
20
17
  XernerxClient,
@@ -32,11 +29,9 @@ export default {
32
29
  ExtensionBuilder,
33
30
  XernerxError,
34
31
  // Constants
35
- version,
32
+ version: xernerxVersion,
36
33
  };
37
34
  export {
38
- // Imported methods
39
- Discord, DumFunctions,
40
35
  // Client
41
36
  XernerxClient,
42
37
  // Enums
@@ -44,4 +39,4 @@ CommandType, EventEmitterType, InhibitorType, ContextCommandType,
44
39
  // Builds
45
40
  EventBuilder, MessageCommandBuilder, ContextCommandBuilder, SlashCommandBuilder, InhibitorBuilder, ExtensionBuilder, XernerxError,
46
41
  // Constants
47
- version, };
42
+ xernerxVersion, };
@@ -1,7 +1,7 @@
1
- import { MessageCommandBuilder } from '../main.js';
1
+ import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
2
2
  import { XernerxInteraction, XernerxMessage } from '../types/types.js';
3
3
  export declare class InteractionArguments {
4
- interaction: XernerxInteraction;
4
+ private interaction;
5
5
  constructor(interaction: XernerxInteraction);
6
6
  group(): string | undefined;
7
7
  subcommand(): string | undefined;
@@ -81,9 +81,11 @@ export async function messageArguments(message, command) {
81
81
  args[argument.name] = role;
82
82
  }
83
83
  else if (argument.type == 'member') {
84
- let member = message.guild?.members.cache.find((m) => m?.nickname?.toLowerCase()?.includes(content[0]) || m?.user?.username?.toLowerCase()?.includes(content[0])) || null;
84
+ let member = message.guild?.members.cache.find((m) => m?.nickname?.toLowerCase()?.includes(content[0]) ||
85
+ m?.user?.username?.toLowerCase()?.includes(content[0])) || null;
85
86
  try {
86
- member = (await message.guild?.members.fetch(member?.id || content[0].replace(/<@!?|>/g, ''))) || null;
87
+ member =
88
+ (await message.guild?.members.fetch(member?.id || content[0].replace(/<@!?|>/g, ''))) || null;
87
89
  }
88
90
  catch (e) {
89
91
  member = null;
@@ -1,24 +1,24 @@
1
1
  import XernerxClient from '../client/XernerxClient.js';
2
2
  export declare class MessageCommandEvents {
3
- client: XernerxClient;
3
+ private client;
4
4
  constructor(client: XernerxClient);
5
5
  messageCreate(): void;
6
6
  messageUpdate(): void;
7
7
  messageDelete(): void;
8
8
  }
9
9
  export declare class SlashCommandEvents {
10
- client: XernerxClient;
10
+ private client;
11
11
  constructor(client: XernerxClient);
12
12
  slashCreate(): void;
13
13
  }
14
14
  export declare class ContextCommandEvents {
15
- client: XernerxClient;
15
+ private client;
16
16
  constructor(client: XernerxClient);
17
17
  contextCreate(): void;
18
18
  }
19
19
  export declare class CommandsDeploy {
20
- client: XernerxClient;
20
+ private client;
21
21
  constructor(client: XernerxClient);
22
22
  deploy(): void;
23
- put(type: string, guild: string, body: Array<object>): void;
23
+ private put;
24
24
  }