xernerx 3.5.2 → 4.0.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 (194) hide show
  1. package/dist/build/ContextCommandBuilder.d.ts +47 -0
  2. package/dist/build/ContextCommandBuilder.js +78 -0
  3. package/dist/{cjs/build → build}/EventBuilder.d.ts +7 -6
  4. package/dist/build/EventBuilder.js +35 -0
  5. package/dist/build/InhibitorBuilder.d.ts +17 -0
  6. package/dist/build/InhibitorBuilder.js +26 -0
  7. package/dist/build/MessageCommandBuilder.d.ts +43 -0
  8. package/dist/build/MessageCommandBuilder.js +71 -0
  9. package/dist/{cjs/build → build}/SlashCommandBuilder.d.ts +16 -31
  10. package/dist/build/SlashCommandBuilder.js +122 -0
  11. package/dist/build copy/ContextCommandBuilder.d.ts +37 -0
  12. package/dist/build copy/ContextCommandBuilder.js +88 -0
  13. package/dist/{mjs/build/EventBuilder.d.ts → build copy/EventBuilder.d.ts } +4 -4
  14. package/dist/build copy/EventBuilder.js +34 -0
  15. package/dist/{cjs/build/InhibitorBuilder.d.ts → build copy/InhibitorBuilder.d.ts } +2 -2
  16. package/dist/build copy/InhibitorBuilder.js +27 -0
  17. package/dist/{cjs/build/MessageCommandBuilder.d.ts → build copy/MessageCommandBuilder.d.ts } +14 -34
  18. package/dist/build copy/MessageCommandBuilder.js +90 -0
  19. package/dist/build copy/SlashCommandBuilder.d.ts +41 -0
  20. package/dist/build copy/SlashCommandBuilder.js +122 -0
  21. package/dist/client/DBLClient.d.ts +8 -0
  22. package/dist/client/DBLClient.js +15 -0
  23. package/dist/client/Top.ggClient.d.ts +1 -0
  24. package/dist/client/Top.ggClient.js +1 -0
  25. package/dist/client/XernerxClient.d.ts +54 -0
  26. package/dist/client/XernerxClient.js +90 -0
  27. package/dist/events/messageCreate.d.ts +1 -0
  28. package/dist/events/messageCreate.js +1 -0
  29. package/dist/functions/AsyncFunctions.d.ts +1 -0
  30. package/dist/functions/AsyncFunctions.js +1 -0
  31. package/dist/functions/delay.d.ts +1 -0
  32. package/dist/functions/delay.js +3 -0
  33. package/dist/functions/deploy.d.ts +2 -0
  34. package/dist/functions/deploy.js +29 -0
  35. package/dist/functions/getPermissionBitField.d.ts +2 -0
  36. package/dist/functions/getPermissionBitField.js +17 -0
  37. package/dist/functions/hasVoted.d.ts +1 -0
  38. package/dist/functions/hasVoted.js +1 -0
  39. package/dist/functions/isOwner.d.ts +3 -0
  40. package/dist/functions/isOwner.js +3 -0
  41. package/dist/functions/isVoter.d.ts +3 -0
  42. package/dist/functions/isVoter.js +5 -0
  43. package/dist/functions/load.d.ts +3 -0
  44. package/dist/functions/load.js +32 -0
  45. package/dist/functions/reload.d.ts +2 -0
  46. package/dist/functions/reload.js +39 -0
  47. package/dist/functions/sendWebhook.d.ts +2 -0
  48. package/dist/functions/sendWebhook.js +12 -0
  49. package/dist/functions/voted.d.ts +1 -0
  50. package/dist/functions/voted.js +1 -0
  51. package/dist/functions/xernerxUser.d.ts +3 -0
  52. package/dist/functions/xernerxUser.js +8 -0
  53. package/dist/handlers/CommandHandler.d.ts +13 -0
  54. package/dist/handlers/CommandHandler.js +220 -0
  55. package/dist/handlers/EventHandler.d.ts +7 -0
  56. package/dist/handlers/EventHandler.js +24 -0
  57. package/dist/handlers/ExtensionHandler.d.ts +7 -0
  58. package/dist/handlers/ExtensionHandler.js +19 -0
  59. package/dist/handlers/Handler.d.ts +14 -0
  60. package/dist/handlers/Handler.js +36 -0
  61. package/dist/handlers/InhibitorHandler.d.ts +7 -0
  62. package/dist/handlers/InhibitorHandler.js +24 -0
  63. package/dist/handlers/WebhookHandler.d.ts +7 -0
  64. package/dist/handlers/WebhookHandler.js +50 -0
  65. package/dist/main.d.ts +11 -0
  66. package/dist/main.js +11 -0
  67. package/dist/models/Arguments.d.ts +15 -0
  68. package/dist/models/Arguments.js +129 -0
  69. package/dist/{mjs/models → models}/CommandArguments.js +2 -7
  70. package/dist/{mjs/models → models}/Events.js +44 -54
  71. package/dist/models/Extensions.js +23 -0
  72. package/dist/models/XernerxUser.d.ts +2 -0
  73. package/dist/models/XernerxUser.js +9 -0
  74. package/dist/tools/XernerxError.d.ts +6 -0
  75. package/dist/tools/XernerxError.js +10 -0
  76. package/dist/tools/XernerxLog.d.ts +13 -0
  77. package/dist/tools/XernerxLog.js +30 -0
  78. package/dist/tools/classes.d.ts +6 -0
  79. package/dist/tools/classes.js +10 -0
  80. package/dist/tools/loggers.d.ts +4 -0
  81. package/dist/tools/loggers.js +4 -0
  82. package/dist/{cjs/tools → tools}/package.d.ts +5 -9
  83. package/dist/{cjs/tools → tools}/package.js +12 -18
  84. package/dist/{cjs/types → types}/enums.js +8 -11
  85. package/dist/types/extenders.d.ts +23 -0
  86. package/dist/types/extenders.js +1 -0
  87. package/dist/types/interfaces.d.ts +224 -0
  88. package/dist/types/interfaces.js +1 -0
  89. package/dist/{cjs/types → types}/options.d.ts +13 -0
  90. package/dist/types/options.js +1 -0
  91. package/dist/types/types.d.ts +181 -0
  92. package/dist/types/types.js +1 -0
  93. package/dist/utils/ClientUtil.d.ts +6 -0
  94. package/dist/utils/ClientUtil.js +7 -0
  95. package/dist/{cjs/utils → utils}/CommandUtil.js +14 -29
  96. package/dist/utils/InteractionArguments.d.ts +1 -0
  97. package/dist/utils/InteractionArguments.js +1 -0
  98. package/dist/utils/InteractionUtil.d.ts +10 -0
  99. package/dist/utils/InteractionUtil.js +15 -0
  100. package/dist/utils/MessageUtil.d.ts +11 -0
  101. package/dist/utils/MessageUtil.js +42 -0
  102. package/dist/utils/Util.d.ts +5 -0
  103. package/dist/utils/Util.js +6 -0
  104. package/dist/{mjs/validators → validators}/CommandValidations.js +11 -14
  105. package/dist/validators/InhibitorValidations.d.ts +18 -0
  106. package/dist/validators/InhibitorValidations.js +34 -0
  107. package/dist/validators/commandValidation.d.ts +6 -0
  108. package/dist/validators/commandValidation.js +48 -0
  109. package/dist/validators/commands.d.ts +4 -0
  110. package/dist/validators/commands.js +25 -0
  111. package/package.json +10 -13
  112. package/dist/cjs/build/ContextCommandBuilder.d.ts +0 -68
  113. package/dist/cjs/build/ContextCommandBuilder.js +0 -97
  114. package/dist/cjs/build/EventBuilder.js +0 -44
  115. package/dist/cjs/build/InhibitorBuilder.js +0 -37
  116. package/dist/cjs/build/MessageCommandBuilder.js +0 -100
  117. package/dist/cjs/build/SlashCommandBuilder.js +0 -169
  118. package/dist/cjs/client/XernerxClient.d.ts +0 -28
  119. package/dist/cjs/client/XernerxClient.js +0 -116
  120. package/dist/cjs/handlers/CommandHandler.d.ts +0 -27
  121. package/dist/cjs/handlers/CommandHandler.js +0 -45
  122. package/dist/cjs/handlers/EventHandler.d.ts +0 -13
  123. package/dist/cjs/handlers/EventHandler.js +0 -19
  124. package/dist/cjs/handlers/Handler.d.ts +0 -57
  125. package/dist/cjs/handlers/Handler.js +0 -308
  126. package/dist/cjs/handlers/InhibitorHandler.d.ts +0 -18
  127. package/dist/cjs/handlers/InhibitorHandler.js +0 -24
  128. package/dist/cjs/main.d.ts +0 -44
  129. package/dist/cjs/main.js +0 -112
  130. package/dist/cjs/models/CommandArguments.js +0 -106
  131. package/dist/cjs/models/Events.js +0 -307
  132. package/dist/cjs/models/Extensions.js +0 -26
  133. package/dist/cjs/tools/XernerxError.d.ts +0 -5
  134. package/dist/cjs/tools/XernerxError.js +0 -11
  135. package/dist/cjs/types/interfaces.d.ts +0 -25
  136. package/dist/cjs/types/interfaces.js +0 -2
  137. package/dist/cjs/types/options.js +0 -2
  138. package/dist/cjs/types/types.d.ts +0 -61
  139. package/dist/cjs/types/types.js +0 -2
  140. package/dist/cjs/utils/ClientUtil.d.ts +0 -25
  141. package/dist/cjs/utils/ClientUtil.js +0 -211
  142. package/dist/cjs/validators/CommandValidations.js +0 -169
  143. package/dist/cjs/validators/InhibitorValidations.d.ts +0 -11
  144. package/dist/cjs/validators/InhibitorValidations.js +0 -40
  145. package/dist/mjs/build/ContextCommandBuilder.d.ts +0 -68
  146. package/dist/mjs/build/ContextCommandBuilder.js +0 -97
  147. package/dist/mjs/build/EventBuilder.js +0 -44
  148. package/dist/mjs/build/InhibitorBuilder.d.ts +0 -19
  149. package/dist/mjs/build/InhibitorBuilder.js +0 -37
  150. package/dist/mjs/build/MessageCommandBuilder.d.ts +0 -59
  151. package/dist/mjs/build/MessageCommandBuilder.js +0 -100
  152. package/dist/mjs/build/SlashCommandBuilder.d.ts +0 -65
  153. package/dist/mjs/build/SlashCommandBuilder.js +0 -169
  154. package/dist/mjs/client/XernerxClient.d.ts +0 -28
  155. package/dist/mjs/client/XernerxClient.js +0 -116
  156. package/dist/mjs/handlers/CommandHandler.d.ts +0 -27
  157. package/dist/mjs/handlers/CommandHandler.js +0 -45
  158. package/dist/mjs/handlers/EventHandler.d.ts +0 -13
  159. package/dist/mjs/handlers/EventHandler.js +0 -19
  160. package/dist/mjs/handlers/Handler.d.ts +0 -57
  161. package/dist/mjs/handlers/Handler.js +0 -308
  162. package/dist/mjs/handlers/InhibitorHandler.d.ts +0 -18
  163. package/dist/mjs/handlers/InhibitorHandler.js +0 -24
  164. package/dist/mjs/main.d.ts +0 -44
  165. package/dist/mjs/main.js +0 -112
  166. package/dist/mjs/models/CommandArguments.d.ts +0 -17
  167. package/dist/mjs/models/Events.d.ts +0 -24
  168. package/dist/mjs/models/Extensions.d.ts +0 -7
  169. package/dist/mjs/models/Extensions.js +0 -26
  170. package/dist/mjs/tools/XernerxError.d.ts +0 -5
  171. package/dist/mjs/tools/XernerxError.js +0 -11
  172. package/dist/mjs/tools/package.d.ts +0 -49
  173. package/dist/mjs/tools/package.js +0 -50
  174. package/dist/mjs/types/enums.d.ts +0 -44
  175. package/dist/mjs/types/enums.js +0 -38
  176. package/dist/mjs/types/interfaces.d.ts +0 -25
  177. package/dist/mjs/types/interfaces.js +0 -2
  178. package/dist/mjs/types/options.d.ts +0 -241
  179. package/dist/mjs/types/options.js +0 -2
  180. package/dist/mjs/types/types.d.ts +0 -61
  181. package/dist/mjs/types/types.js +0 -2
  182. package/dist/mjs/utils/ClientUtil.d.ts +0 -25
  183. package/dist/mjs/utils/ClientUtil.js +0 -211
  184. package/dist/mjs/utils/CommandUtil.d.ts +0 -58
  185. package/dist/mjs/utils/CommandUtil.js +0 -247
  186. package/dist/mjs/validators/CommandValidations.d.ts +0 -12
  187. package/dist/mjs/validators/InhibitorValidations.d.ts +0 -11
  188. package/dist/mjs/validators/InhibitorValidations.js +0 -40
  189. /package/dist/{cjs/models → models}/CommandArguments.d.ts +0 -0
  190. /package/dist/{cjs/models → models}/Events.d.ts +0 -0
  191. /package/dist/{cjs/models → models}/Extensions.d.ts +0 -0
  192. /package/dist/{cjs/types → types}/enums.d.ts +0 -0
  193. /package/dist/{cjs/utils → utils}/CommandUtil.d.ts +0 -0
  194. /package/dist/{cjs/validators → validators}/CommandValidations.d.ts +0 -0
@@ -1,49 +0,0 @@
1
- declare const _default: {
2
- name: string;
3
- version: string;
4
- type: string;
5
- description: string;
6
- main: string;
7
- keywords: string[];
8
- author: string;
9
- license: string;
10
- homepage: string;
11
- packageManager: string;
12
- exports: {
13
- import: string;
14
- require: string;
15
- types: string;
16
- node: null;
17
- default: null;
18
- };
19
- scripts: {
20
- start: string;
21
- patch: string;
22
- minor: string;
23
- major: string;
24
- site: string;
25
- commit: string;
26
- write: string;
27
- build: string;
28
- };
29
- repository: {
30
- type: string;
31
- url: string;
32
- };
33
- bugs: {
34
- url: string;
35
- };
36
- dependencies: {
37
- '@sapphire/shapeshift': string;
38
- 'discord.js': string;
39
- dumfunctions: string;
40
- 'xernerx-extension-builder': string;
41
- zod: string;
42
- };
43
- devDependencies: {
44
- prettier: string;
45
- tsup: string;
46
- typescript: string;
47
- };
48
- };
49
- export default _default;
@@ -1,50 +0,0 @@
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
- };
@@ -1,44 +0,0 @@
1
- import {
2
- SlashCommandStringOption,
3
- SlashCommandNumberOption,
4
- SlashCommandIntegerOption,
5
- SlashCommandBooleanOption,
6
- SlashCommandUserOption,
7
- SlashCommandChannelOption,
8
- SlashCommandRoleOption,
9
- SlashCommandMentionableOption,
10
- } from 'discord.js';
11
- export declare enum InhibitorType {
12
- Member = 'Member',
13
- User = 'User',
14
- Guild = 'Guild',
15
- SlashCommand = 'SlashCommand',
16
- MessageCommand = 'MessageCommand',
17
- ContextCommand = 'ContextCommand',
18
- Command = 'Command',
19
- Message = 'Message',
20
- Interaction = 'Interaction',
21
- Channel = 'Channel',
22
- }
23
- export declare enum CommandType {
24
- Message = 'MessageCommand',
25
- Slash = 'SlashCommand',
26
- Context = 'ContextCommand',
27
- Event = 'Event',
28
- Inhibitor = 'Inhibitor',
29
- MessageCommand = 'MessageCommand',
30
- SlashCommand = 'SlashCommand',
31
- ContextCommand = 'ContextCommand',
32
- }
33
- export declare enum ContextCommandType {
34
- Message = 3,
35
- User = 2,
36
- }
37
- export declare enum EventEmitterType {
38
- Client = 'client',
39
- Rest = 'rest',
40
- Process = 'process',
41
- }
42
- export type SlashCommandOptionChoices = SlashCommandStringOption | SlashCommandNumberOption | SlashCommandIntegerOption;
43
- export type SlashCommandOption = SlashCommandOptionChoices | SlashCommandBooleanOption | SlashCommandUserOption | SlashCommandChannelOption | SlashCommandRoleOption | SlashCommandMentionableOption;
44
- export type SlashArgumentTypes = 'String' | 'Number' | 'Boolean' | 'User' | 'Channel' | 'Role' | 'Mentionable' | 'Integer';
@@ -1,38 +0,0 @@
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 = {})));
@@ -1,25 +0,0 @@
1
- import { Collection } from 'discord.js';
2
- import CommandHandler from '../handlers/CommandHandler.js';
3
- import EventHandler from '../handlers/EventHandler.js';
4
- import InhibitorHandler from '../handlers/InhibitorHandler.js';
5
- import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
6
- import ContextCommandBuilder from '../build/ContextCommandBuilder.js';
7
- import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
8
- export interface ClientCommands {
9
- message: Collection<string, MessageCommandBuilder>;
10
- slash: Collection<string, SlashCommandBuilder>;
11
- context: Collection<string, ContextCommandBuilder>;
12
- }
13
- export interface ClientCache {
14
- messages: Collection<string, object>;
15
- cooldowns: Collection<string, object>;
16
- messageCommands: Collection<string, object>;
17
- slashCommands: Collection<string, object>;
18
- contextCommands: Collection<string, object>;
19
- commands: Collection<string, object>;
20
- }
21
- export interface ClientModules {
22
- commandHandler: CommandHandler;
23
- eventHandler: EventHandler;
24
- inhibitorHandler: InhibitorHandler;
25
- }
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,241 +0,0 @@
1
- import { CacheFactory, ChannelType, ContextMenuCommandType, MessageMentionOptions, Partials, PresenceData, RESTOptions, SweeperOptions, WebSocketOptions } from 'discord.js';
2
- import XernerxExtensionBuilder from 'xernerx-extension-builder';
3
- import { InhibitorType } from './enums.js';
4
- import { EventEmitterType, Localizations, MessageCommandArgsTypes } from './types.js';
5
- export interface DiscordOptions {
6
- shards?: number | number[] | 'auto';
7
- closeTimeout?: number;
8
- shardCount?: number;
9
- makeCache?: CacheFactory;
10
- allowedMentions?: MessageMentionOptions;
11
- partials?: Array<Partials>;
12
- failIfNotExists?: boolean;
13
- presence?: PresenceData;
14
- intents: number[];
15
- waitGuildTimeout?: number;
16
- sweepers?: SweeperOptions;
17
- ws?: WebSocketOptions;
18
- rest?: RESTOptions;
19
- jsonTransformer?: (obj: unknown) => unknown;
20
- }
21
- export interface ClientOptions {
22
- ownerId?: string | string[];
23
- permissions?: {
24
- client?: Array<string>;
25
- user?: Array<string>;
26
- dm?: boolean;
27
- };
28
- ignore?: {
29
- owner?: boolean;
30
- users: Array<string>;
31
- channels: Array<string>;
32
- guilds: Array<string>;
33
- };
34
- log?: {
35
- ready: boolean;
36
- error: boolean;
37
- };
38
- cooldown?: {
39
- command?: number;
40
- cache?: number;
41
- };
42
- }
43
- export interface HandlerOptions {
44
- message?: MessageCommandHandlerOptions;
45
- slash?: SlashCommandHandlerOptions;
46
- context?: ContextCommandHandlerOptions;
47
- events?: EventHandlerOptions;
48
- inhibitors?: InhibitorHandlerOptions;
49
- }
50
- export interface ExtensionOptions {
51
- extensions: Array<XernerxExtensionBuilder>;
52
- logging?: boolean;
53
- }
54
- export interface MessageCommandOptions {
55
- name: string;
56
- aliases?: Array<string>;
57
- separator?: string;
58
- description?: string;
59
- info?: string;
60
- category?: string;
61
- prefix?: Array<string> | string;
62
- regex?: string;
63
- channelType?: Array<number>;
64
- cooldown?: number;
65
- ignore?: {
66
- owner?: boolean;
67
- users?: Array<string>;
68
- channels?: Array<string>;
69
- guilds?: Array<string>;
70
- };
71
- strict?: {
72
- owner?: boolean;
73
- users?: Array<string>;
74
- channels?: Array<string>;
75
- guilds?: Array<string>;
76
- };
77
- permissions?: {
78
- client?: Array<string>;
79
- user?: Array<string>;
80
- dm?: boolean;
81
- };
82
- args?: Array<MessageArgumentOptions>;
83
- }
84
- export interface ContextCommandOptions {
85
- name: string;
86
- type: ContextMenuCommandType;
87
- nameLocalizations: Record<Localizations, string>;
88
- description?: string;
89
- info?: string;
90
- category?: string;
91
- channelType?: Array<number> | number;
92
- cooldown?: number;
93
- ignore?: {
94
- owner?: boolean;
95
- users?: Array<string>;
96
- channels?: Array<string>;
97
- guilds?: Array<string>;
98
- };
99
- strict?: {
100
- owner?: boolean;
101
- users?: Array<string>;
102
- channels?: Array<string>;
103
- guilds?: Array<string>;
104
- };
105
- permissions?: {
106
- client?: Array<string>;
107
- users?: Array<string>;
108
- dm?: boolean;
109
- };
110
- defer?: {
111
- reply?: boolean;
112
- ephemeral?: boolean;
113
- fetch?: boolean;
114
- };
115
- }
116
- export interface MessageArgumentOptions {
117
- type: MessageCommandArgsTypes;
118
- content?: Array<string>;
119
- match?: string;
120
- name: string;
121
- prompt?: {
122
- reply: string;
123
- send: string;
124
- };
125
- default?: string | Function;
126
- }
127
- export interface SlashArgumentOptions {
128
- type: 'string' | 'number' | 'boolean' | 'user' | 'channel' | 'role' | 'mentionable' | 'integer';
129
- name: string;
130
- choices: Array<{
131
- name: string;
132
- value: string;
133
- }>;
134
- required: boolean;
135
- description: string;
136
- }
137
- export interface SlashSubcommandOptions {
138
- name: string;
139
- description: string;
140
- args: Array<SlashArgumentOptions>;
141
- }
142
- export interface SlashGroupOptions {
143
- name: string;
144
- description: string;
145
- subcommands: Array<SlashSubcommandOptions>;
146
- }
147
- export interface SlashCommandOptions {
148
- name: string;
149
- description: string;
150
- info?: string;
151
- category?: string;
152
- owner?: boolean;
153
- channelType?: ChannelType;
154
- cooldown?: number;
155
- ignore?: {
156
- owner?: boolean;
157
- users?: Array<string>;
158
- channels?: Array<string>;
159
- guilds?: Array<string>;
160
- };
161
- strict?: {
162
- owner?: boolean;
163
- users?: Array<string>;
164
- channels?: Array<string>;
165
- guilds?: Array<string>;
166
- };
167
- permissions: {
168
- client?: Array<string>;
169
- users?: Array<string>;
170
- dm?: boolean;
171
- };
172
- defer?: {
173
- reply?: boolean;
174
- ephemeral?: boolean;
175
- fetchReply?: boolean;
176
- };
177
- args?: Array<SlashArgumentOptions>;
178
- subcommands?: Array<SlashSubcommandOptions>;
179
- groups?: Array<SlashGroupOptions>;
180
- }
181
- export interface MessageCommandHandlerOptions {
182
- directory: string;
183
- prefix: string[] | string;
184
- allowMention?: boolean;
185
- cooldown?: number;
186
- userPermissions?: bigint[];
187
- clientPermissions?: bigint[];
188
- handleEdits?: boolean;
189
- handleDeletes?: boolean;
190
- handleTyping?: boolean;
191
- util?: boolean;
192
- logging?: boolean;
193
- }
194
- export interface SlashCommandHandlerOptions {
195
- directory: string;
196
- guildId: string;
197
- global: boolean;
198
- cooldown?: number;
199
- userPermissions?: bigint[];
200
- clientPermissions?: bigint[];
201
- util?: boolean;
202
- logging?: boolean;
203
- defer?: {
204
- reply?: boolean;
205
- ephemeral?: boolean;
206
- fetchReply?: boolean;
207
- };
208
- }
209
- export interface ContextCommandHandlerOptions {
210
- directory: string;
211
- guildId: string;
212
- global: boolean;
213
- cooldown?: number;
214
- userPermissions?: bigint[];
215
- clientPermissions?: bigint[];
216
- util?: boolean;
217
- logging?: boolean;
218
- defer?: {
219
- reply?: boolean;
220
- ephemeral?: boolean;
221
- fetchReply?: boolean;
222
- };
223
- }
224
- export interface EventHandlerOptions {
225
- directory: string;
226
- logging?: boolean;
227
- }
228
- export interface EventOptions {
229
- name: string;
230
- emitter?: EventEmitterType | string;
231
- type?: 'discord' | string;
232
- once?: boolean;
233
- }
234
- export interface InhibitorHandlerOptions {
235
- directory: string;
236
- logging?: boolean;
237
- }
238
- export interface InhibitorOptions {
239
- name: string;
240
- type: InhibitorType;
241
- }
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,61 +0,0 @@
1
- import { TextChannel, Message, User, Guild, GuildMember, Channel, Role, InteractionResponse } from 'discord.js';
2
- import { InteractionCommandUtil, MessageCommandUtil } from '../utils/CommandUtil.js';
3
- export interface XernerxMessage extends Message {
4
- util?: MessageCommandUtil;
5
- response?: string;
6
- }
7
- export interface XernerxInteraction extends InteractionResponse {
8
- util: InteractionCommandUtil;
9
- options?: {
10
- _group: string;
11
- _subcommand: string;
12
- _hoistedOptions: Array<{
13
- name: string;
14
- channel: Channel;
15
- user: XernerxUser;
16
- role: XernerxRole;
17
- value: string;
18
- }>;
19
- };
20
- }
21
- export interface XernerxUser extends User {
22
- isOwner: boolean;
23
- }
24
- export interface XernerxRole extends Role {}
25
- export interface XernerxTextChannel extends TextChannel {}
26
- export interface XernerxGuild extends Guild {}
27
- export interface XernerxMember extends GuildMember {}
28
- export type MessageCommandArgsTypes = 'rest' | 'option' | 'flag' | 'string' | 'number' | 'channel' | 'user' | 'member' | 'boolean' | 'role';
29
- export type Localizations =
30
- | 'id'
31
- | 'da'
32
- | 'de'
33
- | 'en-GB'
34
- | 'en-US'
35
- | 'es-ES'
36
- | 'fr'
37
- | 'hr'
38
- | 'it'
39
- | 'lt'
40
- | 'hu'
41
- | 'nl'
42
- | 'no'
43
- | 'pl'
44
- | 'pt-BR'
45
- | 'ro'
46
- | 'fi'
47
- | 'sv-SE'
48
- | 'vi'
49
- | 'tr'
50
- | 'cs'
51
- | 'el'
52
- | 'bg'
53
- | 'ru'
54
- | 'uk'
55
- | 'hi'
56
- | 'th'
57
- | 'zh-CN'
58
- | 'ja'
59
- | 'zh-TW'
60
- | 'ko';
61
- export type EventEmitterType = 'client' | 'process';
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,25 +0,0 @@
1
- import { ActivityType, ClientPresenceStatus } from 'discord.js';
2
- import XernerxClient from '../client/XernerxClient.js';
3
- interface Presence {
4
- text?: string;
5
- type?: ActivityType.Playing | ActivityType.Streaming | ActivityType.Listening | ActivityType.Watching | ActivityType.Competing;
6
- link?: string;
7
- status?: ClientPresenceStatus;
8
- interval?: number;
9
- }
10
- export declare class ClientUtil {
11
- client: XernerxClient;
12
- constructor(client: XernerxClient);
13
- uptime(timestamp: number | null): string;
14
- getSubcommands(name: string): object[];
15
- isOwner(userId: string): boolean;
16
- getAllCommands(): object[];
17
- getAllMessageCommands(): object[];
18
- getAllSlashCommands(): object[];
19
- getAllContextCommands(): object[];
20
- setPresence(options: Presence): void;
21
- getCooldowns(id: string, command?: string): any;
22
- getCooldownTimers(id: string, command?: string): any;
23
- defer(time: number): Promise<unknown>;
24
- }
25
- export {};