xernerx 4.14.0 → 4.15.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.
- package/dist/cjs/build/XernerxContextCommand.js +124 -0
- package/dist/cjs/build/XernerxEvent.js +34 -0
- package/dist/cjs/build/XernerxInhibitor.js +30 -0
- package/dist/cjs/build/XernerxMessageCommand.js +122 -0
- package/dist/cjs/build/XernerxSlashCommand.js +180 -0
- package/dist/cjs/client/XernerxClient.js +105 -0
- package/dist/cjs/client/XernerxShardClient.js +56 -0
- package/dist/cjs/functions/deploy.js +66 -0
- package/dist/cjs/functions/load.js +38 -0
- package/dist/cjs/functions/reload.js +33 -0
- package/dist/cjs/functions/setPresence.js +24 -0
- package/dist/cjs/functions/xernerxUser.js +15 -0
- package/dist/cjs/handlers/CommandHandler.js +342 -0
- package/dist/cjs/handlers/EventHandler.js +32 -0
- package/dist/cjs/handlers/ExtensionHandler.js +32 -0
- package/dist/cjs/handlers/Handler.js +48 -0
- package/dist/cjs/handlers/InhibitorHandler.js +34 -0
- package/dist/cjs/handlers/IntegrationHandler.js +29 -0
- package/dist/cjs/main.js +36 -0
- package/dist/cjs/models/Arguments.js +159 -0
- package/dist/cjs/models/Cooldowns.js +36 -0
- package/dist/cjs/tools/XernerxError.js +14 -0
- package/dist/cjs/tools/XernerxIntents.js +27 -0
- package/dist/cjs/tools/XernerxLog.js +98 -0
- package/dist/cjs/tools/XernerxText.js +92 -0
- package/dist/cjs/types/extenders.js +3 -0
- package/dist/cjs/types/interfaces.js +3 -0
- package/dist/cjs/types/types.js +3 -0
- package/dist/{utils → cjs/utils}/ClientUtil.d.ts +2 -1
- package/dist/cjs/utils/ClientUtil.js +84 -0
- package/dist/{utils → cjs/utils}/InteractionUtil.d.ts +3 -2
- package/dist/cjs/utils/InteractionUtil.js +156 -0
- package/dist/{utils → cjs/utils}/MessageUtil.d.ts +3 -0
- package/dist/cjs/utils/MessageUtil.js +170 -0
- package/dist/cjs/utils/Util.js +14 -0
- package/dist/cjs/validators/commandValidation.js +127 -0
- package/dist/{validators → cjs/validators}/inhibitorValidations.d.ts +1 -1
- package/dist/cjs/validators/inhibitorValidations.js +49 -0
- package/dist/mjs/build/XernerxContextCommand.d.ts +53 -0
- package/dist/mjs/build/XernerxEvent.d.ts +25 -0
- package/dist/mjs/build/XernerxInhibitor.d.ts +29 -0
- package/dist/mjs/build/XernerxMessageCommand.d.ts +57 -0
- package/dist/mjs/build/XernerxSlashCommand.d.ts +69 -0
- package/dist/mjs/client/XernerxClient.d.ts +53 -0
- package/dist/mjs/client/XernerxShardClient.d.ts +21 -0
- package/dist/mjs/functions/deploy.d.ts +3 -0
- package/dist/mjs/functions/load.d.ts +4 -0
- package/dist/mjs/functions/reload.d.ts +3 -0
- package/dist/mjs/functions/setPresence.d.ts +4 -0
- package/dist/mjs/functions/xernerxUser.d.ts +4 -0
- package/dist/mjs/handlers/CommandHandler.d.ts +16 -0
- package/dist/{handlers → mjs/handlers}/CommandHandler.js +1 -1
- package/dist/mjs/handlers/EventHandler.d.ts +9 -0
- package/dist/mjs/handlers/ExtensionHandler.d.ts +9 -0
- package/dist/mjs/handlers/Handler.d.ts +14 -0
- package/dist/mjs/handlers/InhibitorHandler.d.ts +9 -0
- package/dist/{handlers/WebhookHandler.d.ts → mjs/handlers/IntegrationHandler.d.ts} +8 -1
- package/dist/mjs/main.d.ts +40 -0
- package/dist/mjs/models/Arguments.d.ts +9 -0
- package/dist/mjs/models/Cooldowns.d.ts +11 -0
- package/dist/mjs/tools/XernerxError.d.ts +7 -0
- package/dist/mjs/tools/XernerxIntents.d.ts +5 -0
- package/dist/mjs/tools/XernerxLog.d.ts +28 -0
- package/dist/mjs/tools/XernerxText.d.ts +30 -0
- package/dist/mjs/types/extenders.d.ts +61 -0
- package/dist/mjs/types/interfaces.d.ts +256 -0
- package/dist/mjs/types/types.d.ts +14 -0
- package/dist/mjs/utils/ClientUtil.d.ts +19 -0
- package/dist/{utils → mjs/utils}/ClientUtil.js +3 -0
- package/dist/mjs/utils/InteractionUtil.d.ts +25 -0
- package/dist/{utils → mjs/utils}/InteractionUtil.js +33 -3
- package/dist/mjs/utils/MessageUtil.d.ts +26 -0
- package/dist/{utils → mjs/utils}/MessageUtil.js +29 -0
- package/dist/mjs/utils/Util.d.ts +9 -0
- package/dist/mjs/validators/commandValidation.d.ts +7 -0
- package/dist/{validators → mjs/validators}/commandValidation.js +10 -22
- package/dist/mjs/validators/inhibitorValidations.d.ts +9 -0
- package/package.json +7 -4
- package/dist/functions/sendWebhook.d.ts +0 -4
- package/dist/functions/sendWebhook.js +0 -14
- package/dist/handlers/WebhookHandler.js +0 -10
- package/dist/{build → cjs/build}/XernerxContextCommand.d.ts +0 -0
- package/dist/{build → cjs/build}/XernerxEvent.d.ts +0 -0
- package/dist/{build → cjs/build}/XernerxInhibitor.d.ts +0 -0
- package/dist/{build → cjs/build}/XernerxMessageCommand.d.ts +0 -0
- package/dist/{build → cjs/build}/XernerxSlashCommand.d.ts +0 -0
- package/dist/{client → cjs/client}/XernerxClient.d.ts +3 -3
- /package/dist/{client → cjs/client}/XernerxShardClient.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/deploy.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/load.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/reload.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/setPresence.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/xernerxUser.d.ts +0 -0
- /package/dist/{handlers → cjs/handlers}/CommandHandler.d.ts +0 -0
- /package/dist/{handlers → cjs/handlers}/EventHandler.d.ts +0 -0
- /package/dist/{handlers → cjs/handlers}/ExtensionHandler.d.ts +0 -0
- /package/dist/{handlers → cjs/handlers}/Handler.d.ts +0 -0
- /package/dist/{handlers → cjs/handlers}/InhibitorHandler.d.ts +0 -0
- /package/dist/{handlers → cjs/handlers}/IntegrationHandler.d.ts +0 -0
- /package/dist/{main.d.ts → cjs/main.d.ts} +0 -0
- /package/dist/{models → cjs/models}/Arguments.d.ts +0 -0
- /package/dist/{models → cjs/models}/Cooldowns.d.ts +0 -0
- /package/dist/{tools → cjs/tools}/XernerxError.d.ts +0 -0
- /package/dist/{tools → cjs/tools}/XernerxIntents.d.ts +0 -0
- /package/dist/{tools → cjs/tools}/XernerxLog.d.ts +0 -0
- /package/dist/{tools → cjs/tools}/XernerxText.d.ts +0 -0
- /package/dist/{types → cjs/types}/extenders.d.ts +0 -0
- /package/dist/{types → cjs/types}/interfaces.d.ts +0 -0
- /package/dist/{types → cjs/types}/types.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/Util.d.ts +0 -0
- /package/dist/{validators → cjs/validators}/commandValidation.d.ts +0 -0
- /package/dist/{build → mjs/build}/XernerxContextCommand.js +0 -0
- /package/dist/{build → mjs/build}/XernerxEvent.js +0 -0
- /package/dist/{build → mjs/build}/XernerxInhibitor.js +0 -0
- /package/dist/{build → mjs/build}/XernerxMessageCommand.js +0 -0
- /package/dist/{build → mjs/build}/XernerxSlashCommand.js +0 -0
- /package/dist/{client → mjs/client}/XernerxClient.js +0 -0
- /package/dist/{client → mjs/client}/XernerxShardClient.js +0 -0
- /package/dist/{functions → mjs/functions}/deploy.js +0 -0
- /package/dist/{functions → mjs/functions}/load.js +0 -0
- /package/dist/{functions → mjs/functions}/reload.js +0 -0
- /package/dist/{functions → mjs/functions}/setPresence.js +0 -0
- /package/dist/{functions → mjs/functions}/xernerxUser.js +0 -0
- /package/dist/{handlers → mjs/handlers}/EventHandler.js +0 -0
- /package/dist/{handlers → mjs/handlers}/ExtensionHandler.js +0 -0
- /package/dist/{handlers → mjs/handlers}/Handler.js +0 -0
- /package/dist/{handlers → mjs/handlers}/InhibitorHandler.js +0 -0
- /package/dist/{handlers → mjs/handlers}/IntegrationHandler.js +0 -0
- /package/dist/{main.js → mjs/main.js} +0 -0
- /package/dist/{models → mjs/models}/Arguments.js +0 -0
- /package/dist/{models → mjs/models}/Cooldowns.js +0 -0
- /package/dist/{tools → mjs/tools}/XernerxError.js +0 -0
- /package/dist/{tools → mjs/tools}/XernerxIntents.js +0 -0
- /package/dist/{tools → mjs/tools}/XernerxLog.js +0 -0
- /package/dist/{tools → mjs/tools}/XernerxText.js +0 -0
- /package/dist/{types → mjs/types}/extenders.js +0 -0
- /package/dist/{types → mjs/types}/interfaces.js +0 -0
- /package/dist/{types → mjs/types}/types.js +0 -0
- /package/dist/{utils → mjs/utils}/Util.js +0 -0
- /package/dist/{validators → mjs/validators}/inhibitorValidations.js +0 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { ActivityType, ChannelType, Collection, PresenceStatusData } from 'discord.js';
|
|
3
|
+
import CommandHandler from '../handlers/CommandHandler.js';
|
|
4
|
+
import EventHandler from '../handlers/EventHandler.js';
|
|
5
|
+
import InhibitorHandler from '../handlers/InhibitorHandler.js';
|
|
6
|
+
import IntegrationHandler from '../handlers/IntegrationHandler.js';
|
|
7
|
+
import XernerxContextCommand from '../build/XernerxContextCommand.js';
|
|
8
|
+
import MessageCommandBuilder from '../build/XernerxMessageCommand.js';
|
|
9
|
+
import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
|
|
10
|
+
import { Locales, MessageCommandArgumentType, PermissionNames, SlashCommandArgumentType, XernerxEventType, InhibitorType } from './types.js';
|
|
11
|
+
import ExtensionHandler from '../handlers/ExtensionHandler.js';
|
|
12
|
+
import { XernerxMessage, XernerxUser } from './extenders.js';
|
|
13
|
+
export interface XernerxOptions {
|
|
14
|
+
local: string;
|
|
15
|
+
global?: boolean;
|
|
16
|
+
ownerId?: string | Array<string>;
|
|
17
|
+
ceaseless?: boolean;
|
|
18
|
+
permissions?: {
|
|
19
|
+
user?: Array<PermissionNames> | Array<string> | null;
|
|
20
|
+
client?: Array<PermissionNames> | Array<string> | null;
|
|
21
|
+
dm?: boolean;
|
|
22
|
+
};
|
|
23
|
+
ignore?: {
|
|
24
|
+
owner?: boolean;
|
|
25
|
+
self?: boolean;
|
|
26
|
+
bots?: boolean;
|
|
27
|
+
system?: boolean;
|
|
28
|
+
users?: Array<string>;
|
|
29
|
+
channels?: Array<string>;
|
|
30
|
+
guilds?: Array<string>;
|
|
31
|
+
};
|
|
32
|
+
log?: {
|
|
33
|
+
ready?: boolean;
|
|
34
|
+
info?: boolean;
|
|
35
|
+
warn?: boolean;
|
|
36
|
+
error?: boolean;
|
|
37
|
+
table?: Array<'name' | 'aliases' | 'description' | 'filetype' | 'category'>;
|
|
38
|
+
};
|
|
39
|
+
cooldown?: {
|
|
40
|
+
command?: number;
|
|
41
|
+
cache?: number;
|
|
42
|
+
collections?: Array<string>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface ModuleOptions {
|
|
46
|
+
options: {
|
|
47
|
+
message?: MessageHandlerOptions;
|
|
48
|
+
slash?: SlashHandlerOptions;
|
|
49
|
+
context?: ContextHandlerOptions;
|
|
50
|
+
events?: EventHandlerOptions;
|
|
51
|
+
inhibitors?: InhibitorHandlerOptions;
|
|
52
|
+
};
|
|
53
|
+
commandHandler: CommandHandler;
|
|
54
|
+
eventHandler: EventHandler;
|
|
55
|
+
inhibitorHandler: InhibitorHandler;
|
|
56
|
+
integrationHandler: IntegrationHandler;
|
|
57
|
+
extensionHandler: ExtensionHandler;
|
|
58
|
+
}
|
|
59
|
+
export interface XernerxCommands {
|
|
60
|
+
message: Collection<string, MessageCommandBuilder>;
|
|
61
|
+
slash: Collection<string, XernerxSlashCommand>;
|
|
62
|
+
context: Collection<string, XernerxContextCommand>;
|
|
63
|
+
}
|
|
64
|
+
export interface DBLOptions {
|
|
65
|
+
topgg: {
|
|
66
|
+
token: string;
|
|
67
|
+
};
|
|
68
|
+
dbl: {
|
|
69
|
+
token: string;
|
|
70
|
+
};
|
|
71
|
+
config: {
|
|
72
|
+
emits: boolean;
|
|
73
|
+
logs: boolean;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export interface XernerxCache {
|
|
77
|
+
messages: Collection<string, string>;
|
|
78
|
+
cooldowns: Collection<string, {
|
|
79
|
+
id: string;
|
|
80
|
+
command: string;
|
|
81
|
+
createdTimestamp: number;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
interface CommandHandlerOptions {
|
|
85
|
+
directory: string;
|
|
86
|
+
cooldown?: number;
|
|
87
|
+
permissions?: {
|
|
88
|
+
user?: Array<PermissionNames> | Array<string> | null;
|
|
89
|
+
client?: Array<PermissionNames> | Array<string> | null;
|
|
90
|
+
dm?: boolean;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface MessageHandlerOptions extends CommandHandlerOptions {
|
|
94
|
+
prefix: string | Array<string>;
|
|
95
|
+
allowMention?: boolean;
|
|
96
|
+
handleEdits?: boolean;
|
|
97
|
+
handleDeletes?: boolean;
|
|
98
|
+
handleTyping?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export interface SlashHandlerOptions extends CommandHandlerOptions {
|
|
101
|
+
defer?: {
|
|
102
|
+
reply?: boolean;
|
|
103
|
+
ephemeral?: boolean;
|
|
104
|
+
fetchReply?: boolean;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export interface ContextHandlerOptions extends CommandHandlerOptions {
|
|
108
|
+
defer?: {
|
|
109
|
+
reply?: boolean;
|
|
110
|
+
ephemeral?: boolean;
|
|
111
|
+
fetchReply?: boolean;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export interface EventHandlerOptions {
|
|
115
|
+
directory: string;
|
|
116
|
+
}
|
|
117
|
+
export interface InhibitorHandlerOptions {
|
|
118
|
+
directory: string;
|
|
119
|
+
}
|
|
120
|
+
interface CommandOptions {
|
|
121
|
+
name: string;
|
|
122
|
+
description?: string | null;
|
|
123
|
+
usage?: string | null;
|
|
124
|
+
info?: string | null;
|
|
125
|
+
category?: string | null;
|
|
126
|
+
cooldown?: number | null;
|
|
127
|
+
global?: boolean;
|
|
128
|
+
channel?: Array<keyof typeof ChannelType> | keyof typeof ChannelType | null;
|
|
129
|
+
ignore?: {
|
|
130
|
+
owner?: boolean;
|
|
131
|
+
users?: Array<string>;
|
|
132
|
+
channels?: Array<string>;
|
|
133
|
+
guilds?: Array<string>;
|
|
134
|
+
voice?: boolean;
|
|
135
|
+
};
|
|
136
|
+
strict?: {
|
|
137
|
+
owner?: boolean;
|
|
138
|
+
users?: Array<string>;
|
|
139
|
+
channels?: Array<string>;
|
|
140
|
+
guilds?: Array<string>;
|
|
141
|
+
voice?: boolean;
|
|
142
|
+
};
|
|
143
|
+
permissions?: {
|
|
144
|
+
user?: Array<PermissionNames> | Array<string> | null;
|
|
145
|
+
client?: Array<PermissionNames> | Array<string> | null;
|
|
146
|
+
dm?: boolean;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export interface MessageCommandOptions extends CommandOptions {
|
|
150
|
+
aliases?: Array<string>;
|
|
151
|
+
separator?: string;
|
|
152
|
+
prefix?: Array<string> | string;
|
|
153
|
+
regex?: RegExp;
|
|
154
|
+
channelType?: Array<ChannelType>;
|
|
155
|
+
args?: Array<MessageCommandArgumentOptions>;
|
|
156
|
+
flags?: Array<MessageCommandFlagOptions>;
|
|
157
|
+
}
|
|
158
|
+
export interface MessageCommandArgumentOptions {
|
|
159
|
+
type: MessageCommandArgumentType;
|
|
160
|
+
name: string;
|
|
161
|
+
content?: Array<string>;
|
|
162
|
+
match?: string | Array<string>;
|
|
163
|
+
description?: string;
|
|
164
|
+
default?: string | Function;
|
|
165
|
+
separator?: string | RegExp;
|
|
166
|
+
prompt?: {
|
|
167
|
+
reply?: string;
|
|
168
|
+
send?: string;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export interface MessageCommandFlagOptions {
|
|
172
|
+
name: string;
|
|
173
|
+
match: string;
|
|
174
|
+
}
|
|
175
|
+
export interface MessageCommandArguments {
|
|
176
|
+
args: Record<string, unknown> | null;
|
|
177
|
+
flags: Record<string, boolean> | null;
|
|
178
|
+
}
|
|
179
|
+
export interface SlashCommandOptions extends CommandOptions {
|
|
180
|
+
description: string;
|
|
181
|
+
nameLocalizations?: Record<Locales, string | null> | null;
|
|
182
|
+
descriptionLocalizations?: Record<Locales, string | null> | null;
|
|
183
|
+
defer?: {
|
|
184
|
+
reply?: boolean;
|
|
185
|
+
ephemeral?: boolean;
|
|
186
|
+
fetchReply?: boolean;
|
|
187
|
+
};
|
|
188
|
+
args?: Array<SlashCommandArgumentOptions>;
|
|
189
|
+
subcommands?: Array<SlashCommandSubcommandOptions>;
|
|
190
|
+
groups?: Array<SlashCommandGroupOptions>;
|
|
191
|
+
}
|
|
192
|
+
export interface ContextCommandOptions extends CommandOptions {
|
|
193
|
+
type: 'user' | 'message';
|
|
194
|
+
nameLocalizations?: Record<Locales, string | null> | null;
|
|
195
|
+
defer?: {
|
|
196
|
+
reply?: boolean;
|
|
197
|
+
ephemeral?: boolean;
|
|
198
|
+
fetchReply?: boolean;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
export interface SlashCommandArgumentOptions {
|
|
202
|
+
type: SlashCommandArgumentType;
|
|
203
|
+
name: string;
|
|
204
|
+
description: string;
|
|
205
|
+
required?: boolean;
|
|
206
|
+
autocomplete?: boolean;
|
|
207
|
+
choices?: Array<Record<string, string>>;
|
|
208
|
+
}
|
|
209
|
+
export interface SlashCommandSubcommandOptions {
|
|
210
|
+
name: string;
|
|
211
|
+
description: string;
|
|
212
|
+
args?: Array<SlashCommandArgumentOptions>;
|
|
213
|
+
}
|
|
214
|
+
export interface SlashCommandGroupOptions {
|
|
215
|
+
name: string;
|
|
216
|
+
description: string;
|
|
217
|
+
subcommands: Array<SlashCommandSubcommandOptions>;
|
|
218
|
+
}
|
|
219
|
+
export interface SlashCommandArguments<T = SlashCommandArgumentType> {
|
|
220
|
+
args: Record<string, any>;
|
|
221
|
+
subcommand: string;
|
|
222
|
+
group: string;
|
|
223
|
+
}
|
|
224
|
+
export interface XernerxEventOptions {
|
|
225
|
+
name: XernerxEventType;
|
|
226
|
+
emitter?: 'client' | 'process';
|
|
227
|
+
type?: 'discord' | 'node';
|
|
228
|
+
once?: boolean;
|
|
229
|
+
}
|
|
230
|
+
export interface XernerxInhibitorOptions {
|
|
231
|
+
name: string;
|
|
232
|
+
type: InhibitorType;
|
|
233
|
+
}
|
|
234
|
+
export interface PresenceOptions {
|
|
235
|
+
text: string;
|
|
236
|
+
type?: keyof typeof ActivityType;
|
|
237
|
+
url: string;
|
|
238
|
+
status?: PresenceStatusData;
|
|
239
|
+
interval?: number;
|
|
240
|
+
}
|
|
241
|
+
export type ContextCommandArguments<T extends 'user' | 'message'> = T extends 'user' ? XernerxUser : XernerxMessage;
|
|
242
|
+
export interface PaginatorOptions {
|
|
243
|
+
type?: 'button' | 'select-menu' | 'combined';
|
|
244
|
+
buttons?: Array<string>;
|
|
245
|
+
description?: boolean;
|
|
246
|
+
placeholder?: string;
|
|
247
|
+
index?: number;
|
|
248
|
+
send?: boolean;
|
|
249
|
+
filter?: Function;
|
|
250
|
+
time?: number;
|
|
251
|
+
}
|
|
252
|
+
export interface ResolveCommandOptions {
|
|
253
|
+
type?: 'MessageCommand' | 'SlashCommand' | 'ContextCommand' | 'Interaction';
|
|
254
|
+
name?: string;
|
|
255
|
+
}
|
|
256
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { SlashCommandBooleanOption, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandUserOption } from 'discord.js';
|
|
3
|
+
import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from './extenders.js';
|
|
4
|
+
export type filetype = 'MessageCommand' | 'SlashCommand' | 'ContextCommand' | 'Event' | 'Inhibitor';
|
|
5
|
+
export type Locales = 'en-US' | 'en-GB' | 'bg' | 'zh-CN' | 'zh-TW' | 'hr' | 'cs' | 'da' | 'nl' | 'fi' | 'fr' | 'de' | 'el' | 'hi' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'no' | 'pl' | 'pt-BR' | 'ro' | 'ru' | 'es-ES' | 'sv-SE' | 'th' | 'tr' | 'uk' | 'vi';
|
|
6
|
+
export type SlashCommandArgumentType = 'attachment' | 'boolean' | 'channel' | 'integer' | 'mentionable' | 'number' | 'role' | 'string' | 'user';
|
|
7
|
+
export type SlashCommandOptionChoices = SlashCommandStringOption | SlashCommandNumberOption | SlashCommandIntegerOption;
|
|
8
|
+
export type SlashCommandOption = SlashCommandOptionChoices | SlashCommandBooleanOption | SlashCommandUserOption | SlashCommandChannelOption | SlashCommandRoleOption | SlashCommandMentionableOption;
|
|
9
|
+
export type MessageCommandArgumentType = 'string' | 'number' | 'boolean' | 'confirm' | 'channel' | 'guild' | 'integer' | 'mentionable' | 'role' | 'user' | 'message' | 'member' | 'list' | 'option' | 'rest';
|
|
10
|
+
export type DiscordEventType = 'applicationCommandPermissionsUpdate' | 'autoModerationActionExecution' | 'autoModerationRuleCreate' | 'autoModerationRuleDelete' | 'autoModerationRuleUpdate' | 'ready' | 'guildCreate' | 'guildDelete' | 'guildUpdate' | 'guildUnavailable' | 'guildMemberAdd' | 'guildMemberRemove' | 'guildMemberUpdate' | 'guildMemberAvailable' | 'guildMembersChunk' | 'guildIntegrationsUpdate' | 'roleCreate' | 'roleDelete' | 'inviteCreate' | 'inviteDelete' | 'roleUpdate' | 'emojiCreate' | 'emojiDelete' | 'emojiUpdate' | 'guildBanAdd' | 'guildBanRemove' | 'channelCreate' | 'channelDelete' | 'channelUpdate' | 'channelPinsUpdate' | 'messageCreate' | 'messageDelete' | 'messageUpdate' | 'messageDeleteBulk' | 'messageReactionAdd' | 'messageReactionRemove' | 'messageReactionRemoveAll' | 'messageReactionRemoveEmoji' | 'threadCreate' | 'threadDelete' | 'threadUpdate' | 'threadListSync' | 'threadMemberUpdate' | 'threadMembersUpdate' | 'userUpdate' | 'presenceUpdate' | 'voiceServerUpdate' | 'voiceStateUpdate' | 'typingStart' | 'webhookUpdate' | 'interactionCreate' | 'error' | 'warn' | 'debug' | 'cacheSweep' | 'shardDisconnect' | 'shardError' | 'shardReconnecting' | 'shardReady' | 'shardResume' | 'invalidated' | 'raw' | 'stageInstanceCreate' | 'stageInstanceUpdate' | 'stageInstanceDelete' | 'stickerCreate' | 'stickerDelete' | 'stickerUpdate' | 'guildScheduledEventCreate' | 'guildScheduledEventUpdate' | 'guildScheduledEventDelete' | 'guildScheduledEventUserAdd' | 'guildScheduledEventUserRemove';
|
|
11
|
+
export type XernerxEventType = DiscordEventType | 'webhookCreate' | 'webhookError' | 'commandBlock' | 'commandError' | 'commandStart' | 'commandFinish' | 'commandCooldown';
|
|
12
|
+
export type XernerxInteraction<T extends XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction> = T extends XernerxSlashInteraction ? XernerxSlashInteraction : T extends XernerxUserContextInteraction ? XernerxUserContextInteraction : XernerxMessageContextInteraction;
|
|
13
|
+
export type PermissionNames = 'create instant invite' | 'kick members' | 'ban members' | 'administrator' | 'manage channels' | 'manage guild' | 'add reactions' | 'view audit log' | 'priority speaker' | 'stream' | 'view channel' | 'send messages' | 'send tts messages' | 'manage messages' | 'embed links' | 'attach files' | 'read message history' | 'mention everyone' | 'use external emojis' | 'view guild insights' | 'connect' | 'speak' | 'mute members' | 'deafen members' | 'move members' | 'use vad' | 'change nickname' | 'manage nicknames' | 'manage roles' | 'manage webhooks' | 'manage emojis and stickers' | 'use application commands' | 'request to speak' | 'manage events' | 'manage threads' | 'create public threads' | 'create private threads' | 'use external stickers' | 'send messages in threads' | 'start embedded activities' | 'moderate members';
|
|
14
|
+
export type InhibitorType = '*' | 'message' | 'interaction' | 'command' | 'channel' | 'user' | 'member' | 'guild' | 'contextCommand' | 'messageCommand' | 'slashCommand';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { Collection } from 'discord.js';
|
|
3
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
+
import { PresenceOptions, ResolveCommandOptions } from '../types/interfaces.js';
|
|
5
|
+
import Util from './Util.js';
|
|
6
|
+
import XernerxContextCommand from '../build/XernerxContextCommand.js';
|
|
7
|
+
import XernerxMessageCommand from '../build/XernerxMessageCommand.js';
|
|
8
|
+
import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
|
|
9
|
+
export default class ClientUtil extends Util {
|
|
10
|
+
hasVoted: Function;
|
|
11
|
+
constructor(client: XernerxClient);
|
|
12
|
+
setPresence(options: PresenceOptions): import("discord.js").ClientPresence | undefined;
|
|
13
|
+
private resolveCooldown;
|
|
14
|
+
resolveCommand(options: ResolveCommandOptions): XernerxSlashCommand | XernerxContextCommand | XernerxMessageCommand | Collection<string, XernerxSlashCommand | XernerxContextCommand | XernerxMessageCommand>;
|
|
15
|
+
resolveChannel(query: string | Record<string, string>): Promise<import("discord.js").Channel | null>;
|
|
16
|
+
resolveGuild(query: string | Record<string, string>): Promise<import("discord.js").Guild | null>;
|
|
17
|
+
uptime(timestamp?: number | null): string;
|
|
18
|
+
commands(): (XernerxSlashCommand | XernerxContextCommand | XernerxMessageCommand)[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { EmbedBuilder, InteractionEditReplyOptions, InteractionReplyOptions, MessageCreateOptions, MessagePayload } from 'discord.js';
|
|
3
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
+
import { ContextCommandArguments, PaginatorOptions, SlashCommandArguments } from '../types/interfaces.js';
|
|
5
|
+
import { PermissionNames, XernerxInteraction } from '../types/types.js';
|
|
6
|
+
import Util from './Util.js';
|
|
7
|
+
import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
8
|
+
type MimicOptions = {
|
|
9
|
+
timeout: number;
|
|
10
|
+
};
|
|
11
|
+
export default class InteractionUtil extends Util {
|
|
12
|
+
private readonly interaction;
|
|
13
|
+
parsed: {
|
|
14
|
+
alias: string | null;
|
|
15
|
+
args: (SlashCommandArguments | ContextCommandArguments<'message' | 'user'>) | null;
|
|
16
|
+
};
|
|
17
|
+
constructor(client: XernerxClient, interaction: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>);
|
|
18
|
+
send(content: any): Promise<import("discord.js").Message<false> | import("discord.js").Message<true> | undefined>;
|
|
19
|
+
reply(content: string | MessagePayload | InteractionReplyOptions | InteractionEditReplyOptions): Promise<import("discord.js").InteractionResponse<boolean> | import("discord.js").Message<boolean>>;
|
|
20
|
+
mimic(user: XernerxUser | string, interaction: MessageCreateOptions, options: MimicOptions): Promise<void>;
|
|
21
|
+
paginator(embeds: Array<EmbedBuilder>, options?: PaginatorOptions): Promise<void | import("discord.js").Message<false> | import("discord.js").Message<true>>;
|
|
22
|
+
commands(): import("@discordjs/collection").Collection<string, import("../main.js").XernerxSlashCommand> | import("@discordjs/collection").Collection<string, import("../main.js").XernerxContextCommand>;
|
|
23
|
+
permissionCheck(type: 'user' | 'client', permissions: Array<PermissionNames>): boolean;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @format */
|
|
2
|
-
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder, } from 'discord.js';
|
|
2
|
+
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionType, StringSelectMenuBuilder, } from 'discord.js';
|
|
3
3
|
import Util from './Util.js';
|
|
4
4
|
import XernerxError from '../tools/XernerxError.js';
|
|
5
|
+
import { Style } from 'dumfunctions';
|
|
5
6
|
export default class InteractionUtil extends Util {
|
|
6
7
|
constructor(client, interaction) {
|
|
7
8
|
super(client);
|
|
@@ -38,8 +39,6 @@ export default class InteractionUtil extends Util {
|
|
|
38
39
|
webhook.delete().catch(() => true);
|
|
39
40
|
}, options.timeout);
|
|
40
41
|
}
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
commandName() { }
|
|
43
42
|
async paginator(embeds, options = {}) {
|
|
44
43
|
let buttonRow, menuRow;
|
|
45
44
|
if (embeds.length <= 0)
|
|
@@ -120,4 +119,35 @@ export default class InteractionUtil extends Util {
|
|
|
120
119
|
});
|
|
121
120
|
});
|
|
122
121
|
}
|
|
122
|
+
commands() {
|
|
123
|
+
if (this.interaction.type == InteractionType.ApplicationCommand)
|
|
124
|
+
return this.client.commands.slash;
|
|
125
|
+
else
|
|
126
|
+
return this.client.commands.context;
|
|
127
|
+
}
|
|
128
|
+
permissionCheck(type, permissions) {
|
|
129
|
+
console.log(type);
|
|
130
|
+
const missing = [];
|
|
131
|
+
for (const permission of permissions) {
|
|
132
|
+
if (type == 'user') {
|
|
133
|
+
this.interaction.memberPermissions?.has(Style.pascalCase(permission, true)) ? null : missing.push(permission);
|
|
134
|
+
}
|
|
135
|
+
if (type == 'client') {
|
|
136
|
+
this.interaction.guild?.members.me?.permissionsIn(this.interaction.channel?.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const command = this.commands().toJSON().find((cmd) => cmd.name == this.parsed.alias?.split(/ +/)[0]);
|
|
140
|
+
console.log(type);
|
|
141
|
+
if (missing.length) {
|
|
142
|
+
this.client.emit(`commandBlock`, this.interaction, {
|
|
143
|
+
reason: `missing${Style.pascalCase(type)}Permissions`,
|
|
144
|
+
message: `${type == 'user' ? 'You are' : 'I am'} missing the following permissions to run \`${command?.name}\`:\n${missing.map((permission) => `> - ${permission}`).join('\n')}`,
|
|
145
|
+
required: permissions,
|
|
146
|
+
missing,
|
|
147
|
+
}, command || null);
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
else
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
123
153
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { EmbedBuilder, MessageCreateOptions, MessageEditOptions, MessagePayload, MessageReplyOptions } from 'discord.js';
|
|
3
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
+
import { XernerxMessage, XernerxUser } from '../types/extenders.js';
|
|
5
|
+
import Util from './Util.js';
|
|
6
|
+
import { PaginatorOptions } from '../types/interfaces.js';
|
|
7
|
+
import { PermissionNames } from '../main.js';
|
|
8
|
+
type MimicOptions = {
|
|
9
|
+
timeout: number;
|
|
10
|
+
};
|
|
11
|
+
export default class MessageUtil extends Util {
|
|
12
|
+
private readonly message;
|
|
13
|
+
parsed: {
|
|
14
|
+
alias: string | null;
|
|
15
|
+
prefix: string | null;
|
|
16
|
+
args: Record<string, unknown> | null;
|
|
17
|
+
};
|
|
18
|
+
constructor(client: XernerxClient, message: XernerxMessage);
|
|
19
|
+
send(content: any): Promise<import("discord.js").Message<boolean> | null>;
|
|
20
|
+
reply(content: string | MessagePayload | MessageReplyOptions | MessageEditOptions): Promise<import("discord.js").Message<boolean> | null>;
|
|
21
|
+
mimic(user: XernerxUser | string, message: MessageCreateOptions, options: MimicOptions): Promise<void>;
|
|
22
|
+
paginator(embeds: Array<EmbedBuilder>, options?: PaginatorOptions): Promise<void | import("discord.js").Message<boolean> | null>;
|
|
23
|
+
commands(): import("@discordjs/collection").Collection<string, import("../main.js").XernerxMessageCommand>;
|
|
24
|
+
permissionCheck(type: 'user' | 'client', permissions: Array<PermissionNames>): boolean;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder, } from 'discord.js';
|
|
3
3
|
import Util from './Util.js';
|
|
4
4
|
import XernerxError from '../tools/XernerxError.js';
|
|
5
|
+
import { Style } from 'dumfunctions';
|
|
5
6
|
export default class MessageUtil extends Util {
|
|
6
7
|
constructor(client, message) {
|
|
7
8
|
super(client);
|
|
@@ -135,4 +136,32 @@ export default class MessageUtil extends Util {
|
|
|
135
136
|
});
|
|
136
137
|
});
|
|
137
138
|
}
|
|
139
|
+
commands() {
|
|
140
|
+
return this.client.commands.message;
|
|
141
|
+
}
|
|
142
|
+
permissionCheck(type, permissions) {
|
|
143
|
+
console.log(type);
|
|
144
|
+
const missing = [];
|
|
145
|
+
for (const permission of permissions) {
|
|
146
|
+
if (type == 'user') {
|
|
147
|
+
this.message.member?.permissionsIn(this.message.channel.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission);
|
|
148
|
+
}
|
|
149
|
+
if (type == 'client') {
|
|
150
|
+
this.message.guild?.members.me?.permissionsIn(this.message.channel.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const command = this.commands().find((cmd) => cmd.name == this.parsed.alias || cmd.aliases?.includes(this.parsed.alias));
|
|
154
|
+
console.log(type);
|
|
155
|
+
if (missing.length) {
|
|
156
|
+
this.client.emit(`commandBlock`, this.message, {
|
|
157
|
+
reason: `missing${Style.pascalCase(type)}Permissions`,
|
|
158
|
+
message: `${type == 'user' ? 'You are' : 'I am'} missing the following permissions to run \`${command?.name}\`:\n${missing.map((permission) => `> - ${permission}`).join('\n')}`,
|
|
159
|
+
required: permissions,
|
|
160
|
+
missing,
|
|
161
|
+
}, command || null);
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
else
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
138
167
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
+
import XernerxText from '../tools/XernerxText.js';
|
|
4
|
+
export default class Util {
|
|
5
|
+
readonly client: XernerxClient;
|
|
6
|
+
readonly text: XernerxText;
|
|
7
|
+
constructor(client: XernerxClient);
|
|
8
|
+
delay(time: number): Promise<unknown>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import XernerxContextCommand from '../build/XernerxContextCommand.js';
|
|
3
|
+
import MessageCommandBuilder from '../build/XernerxMessageCommand.js';
|
|
4
|
+
import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
|
|
5
|
+
import { XernerxMessage, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
6
|
+
import { XernerxInteraction } from '../types/types.js';
|
|
7
|
+
export default function commandValidation(event: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction> | XernerxMessage, command: MessageCommandBuilder | XernerxSlashCommand | XernerxContextCommand): Promise<boolean>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @format */
|
|
2
|
-
import { ChannelType
|
|
2
|
+
import { ChannelType } from 'discord.js';
|
|
3
|
+
import { Style } from 'dumfunctions';
|
|
3
4
|
var CommandTypes;
|
|
4
5
|
(function (CommandTypes) {
|
|
5
6
|
CommandTypes["SlashCommand"] = "slash";
|
|
@@ -88,10 +89,10 @@ export default async function commandValidation(event, command) {
|
|
|
88
89
|
reason: 'DMRestricted',
|
|
89
90
|
message: `\`${command.name}\` can't be used in a DM Channel`,
|
|
90
91
|
}, command);
|
|
91
|
-
if (userPermissions) {
|
|
92
|
-
const missing =
|
|
93
|
-
|
|
94
|
-
if (
|
|
92
|
+
if (userPermissions.length) {
|
|
93
|
+
const missing = [];
|
|
94
|
+
userPermissions.map((permission) => event.guild?.members.me?.permissionsIn(event.channel?.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission));
|
|
95
|
+
if (missing.length)
|
|
95
96
|
return await emit(event, {
|
|
96
97
|
reason: 'missingUserPermissions',
|
|
97
98
|
message: `You are missing the following permissions to run \`${command.name}\`:\n${missing.map((permission) => `> - ${permission}`).join('\n')}`,
|
|
@@ -99,10 +100,10 @@ export default async function commandValidation(event, command) {
|
|
|
99
100
|
missing,
|
|
100
101
|
}, command);
|
|
101
102
|
}
|
|
102
|
-
if (clientPermissions) {
|
|
103
|
-
const missing =
|
|
104
|
-
|
|
105
|
-
if (
|
|
103
|
+
if (clientPermissions.length) {
|
|
104
|
+
const missing = [];
|
|
105
|
+
clientPermissions.map((permission) => event.guild?.members.me?.permissionsIn(event.channel?.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission));
|
|
106
|
+
if (missing.length)
|
|
106
107
|
return await emit(event, {
|
|
107
108
|
reason: 'missingClientPermissions',
|
|
108
109
|
message: `I am missing the following permissions to run \`${command.name}\`:\n${missing.map((permission) => `> - ${permission}`).join('\n')}`,
|
|
@@ -121,16 +122,3 @@ async function emit(event, info, command) {
|
|
|
121
122
|
event.client.emit('commandBlock', event, info, command);
|
|
122
123
|
return true;
|
|
123
124
|
}
|
|
124
|
-
function toBigInt(permissions) {
|
|
125
|
-
let bigIntPermissions = 0n;
|
|
126
|
-
permissions.map((permission) => {
|
|
127
|
-
permission =
|
|
128
|
-
PermissionFlagsBits[permission
|
|
129
|
-
.split(/ +/)
|
|
130
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
131
|
-
.join('')];
|
|
132
|
-
if (typeof permission === 'bigint')
|
|
133
|
-
bigIntPermissions += permission;
|
|
134
|
-
});
|
|
135
|
-
return bigIntPermissions;
|
|
136
|
-
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
import { ContextCommandArguments, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';
|
|
3
|
+
import XernerxContextCommand from '../build/XernerxContextCommand.js';
|
|
4
|
+
import XernerxMessageCommand from '../build/XernerxMessageCommand.js';
|
|
5
|
+
import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
|
|
6
|
+
import { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
7
|
+
import { InhibitorType, XernerxInteraction } from '../types/types.js';
|
|
8
|
+
export declare function inhibitorValidation(event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, args?: SlashCommandArguments | MessageCommandArguments | ContextCommandArguments<'user' | 'message'> | null, cmd?: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand, type?: 'pre' | 'check' | 'post'): Promise<boolean>;
|
|
9
|
+
export declare function inhibitorArguments(event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, cmd: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand | null, type: InhibitorType): import("../types/extenders.js").XernerxUser | import("discord.js").GuildMember | import("discord.js").Guild | import("discord.js").TextBasedChannel | XernerxSlashCommand | XernerxContextCommand | XernerxMessageCommand | import("discord.js").APIInteractionGuildMember | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xernerx",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "A bot framework for discord.js.",
|
|
5
|
-
"main": "dist/main.js",
|
|
5
|
+
"main": "dist/cjs/main.js",
|
|
6
|
+
"module": "dist/mjs/main.js",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"keywords": [
|
|
8
9
|
"discord.js",
|
|
@@ -30,7 +31,9 @@
|
|
|
30
31
|
"site": "git add docs && npm run commit && git push",
|
|
31
32
|
"write": "npm i && npm run build && npm run format",
|
|
32
33
|
"format": "npx prettier --write src dist",
|
|
33
|
-
"build": "
|
|
34
|
+
"build": "npm run build:esm && npm run build:cjs && npm run format",
|
|
35
|
+
"build:esm": "tsc",
|
|
36
|
+
"build:cjs": "tsc --module CommonJS --outDir dist/cjs"
|
|
34
37
|
},
|
|
35
38
|
"repository": {
|
|
36
39
|
"type": "git",
|
|
@@ -42,7 +45,7 @@
|
|
|
42
45
|
"dependencies": {
|
|
43
46
|
"dbl-sdk": "^2.0.3",
|
|
44
47
|
"discord.js": "^14.14.1",
|
|
45
|
-
"dumfunctions": "2.1.
|
|
48
|
+
"dumfunctions": "^2.1.6",
|
|
46
49
|
"xernerx-extension-builder": "0.0.16",
|
|
47
50
|
"zod": "^3.22.4"
|
|
48
51
|
},
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
export default async function sendWebhook(url, body) {
|
|
3
|
-
const response = await fetch(url, {
|
|
4
|
-
method: 'POST',
|
|
5
|
-
headers: {
|
|
6
|
-
'Content-Type': 'application/json',
|
|
7
|
-
},
|
|
8
|
-
body: JSON.stringify(body),
|
|
9
|
-
});
|
|
10
|
-
if (response.status === 204)
|
|
11
|
-
return true;
|
|
12
|
-
const data = await response.json();
|
|
13
|
-
return data;
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
// import XernerxLog from '../tools/XernerxLog.js';
|
|
3
|
-
import Handler from './Handler.js';
|
|
4
|
-
export default class IntegrationHandler extends Handler {
|
|
5
|
-
constructor(client) {
|
|
6
|
-
super(client);
|
|
7
|
-
this.readyTimestamp = Number(Date.now());
|
|
8
|
-
}
|
|
9
|
-
async loadIntegrations(options) { }
|
|
10
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -17,19 +17,19 @@ export default class XernerxClient extends Client {
|
|
|
17
17
|
dm: boolean;
|
|
18
18
|
} | undefined;
|
|
19
19
|
ignore?: {
|
|
20
|
+
system: boolean;
|
|
21
|
+
users: string[];
|
|
20
22
|
owner: boolean;
|
|
21
23
|
self: boolean;
|
|
22
24
|
bots: boolean;
|
|
23
|
-
system: boolean;
|
|
24
|
-
users: string[];
|
|
25
25
|
channels: string[];
|
|
26
26
|
guilds: string[];
|
|
27
27
|
} | undefined;
|
|
28
28
|
log?: boolean | {
|
|
29
|
+
warn: boolean;
|
|
29
30
|
error: boolean;
|
|
30
31
|
ready: boolean;
|
|
31
32
|
info: boolean;
|
|
32
|
-
warn: boolean;
|
|
33
33
|
table: string[] | null;
|
|
34
34
|
} | undefined;
|
|
35
35
|
cooldown?: {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|