xernerx 4.4.13 → 4.4.14
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/build/ContextCommandBuilder.d.ts +31 -23
- package/dist/build/ContextCommandBuilder.js +39 -39
- package/dist/build/EventBuilder.d.ts +1 -1
- package/dist/build/EventBuilder.js +2 -2
- package/dist/build/InhibitorBuilder.d.ts +1 -1
- package/dist/build/InhibitorBuilder.js +2 -2
- package/dist/build/MessageCommandBuilder.d.ts +26 -20
- package/dist/build/MessageCommandBuilder.js +34 -34
- package/dist/build/SlashCommandBuilder.d.ts +31 -23
- package/dist/build/SlashCommandBuilder.js +48 -48
- package/dist/client/XernerxClient.d.ts +30 -22
- package/dist/client/XernerxClient.js +33 -33
- package/dist/client/XernerxShardClient.d.ts +1 -1
- package/dist/client/XernerxShardClient.d.ts.map +1 -1
- package/dist/client/XernerxShardClient.js +18 -12
- package/dist/client/XernerxShardClient.js.map +1 -1
- package/dist/functions/delay.d.ts +1 -1
- package/dist/functions/delay.js +1 -1
- package/dist/functions/deploy.d.ts +1 -1
- package/dist/functions/deploy.js +13 -16
- package/dist/functions/isOwner.d.ts +1 -1
- package/dist/functions/isOwner.js +1 -1
- package/dist/functions/isVoter.d.ts +1 -1
- package/dist/functions/isVoter.js +1 -1
- package/dist/functions/load.d.ts +1 -1
- package/dist/functions/load.js +2 -3
- package/dist/functions/reload.d.ts +1 -1
- package/dist/functions/reload.js +9 -12
- package/dist/functions/sendWebhook.d.ts +1 -1
- package/dist/functions/sendWebhook.js +2 -3
- package/dist/functions/setPresence.d.ts +2 -2
- package/dist/functions/setPresence.js +12 -11
- package/dist/functions/xernerxUser.d.ts +1 -1
- package/dist/functions/xernerxUser.js +1 -1
- package/dist/handlers/CommandHandler.d.ts +1 -1
- package/dist/handlers/CommandHandler.js +82 -105
- package/dist/handlers/EventHandler.d.ts +1 -1
- package/dist/handlers/EventHandler.js +3 -3
- package/dist/handlers/ExtensionHandler.d.ts +1 -1
- package/dist/handlers/ExtensionHandler.js +3 -5
- package/dist/handlers/Handler.d.ts +1 -1
- package/dist/handlers/Handler.js +6 -16
- package/dist/handlers/InhibitorHandler.d.ts +1 -1
- package/dist/handlers/InhibitorHandler.js +3 -3
- package/dist/handlers/WebhookHandler.d.ts +2 -4
- package/dist/handlers/WebhookHandler.js +9 -6
- package/dist/main.d.ts +29 -22
- package/dist/main.js +29 -22
- package/dist/models/Arguments.d.ts +1 -1
- package/dist/models/Arguments.js +48 -63
- package/dist/tools/XernerxError.d.ts +1 -1
- package/dist/tools/XernerxError.js +1 -1
- package/dist/tools/XernerxLog.d.ts +1 -1
- package/dist/tools/XernerxLog.js +7 -2
- package/dist/types/extenders.d.ts +5 -9
- package/dist/types/extenders.js +1 -1
- package/dist/types/interfaces.d.ts +9 -6
- package/dist/types/interfaces.js +1 -1
- package/dist/types/types.d.ts +174 -6
- package/dist/types/types.js +1 -1
- package/dist/utils/ClientUtil.d.ts +4 -4
- package/dist/utils/ClientUtil.js +8 -14
- package/dist/utils/InteractionUtil.d.ts +2 -2
- package/dist/utils/InteractionUtil.js +1 -1
- package/dist/utils/MessageUtil.d.ts +2 -2
- package/dist/utils/MessageUtil.js +5 -9
- package/dist/utils/Util.d.ts +1 -1
- package/dist/utils/Util.js +1 -1
- package/dist/validators/commandValidation.d.ts +1 -1
- package/dist/validators/commandValidation.js +19 -29
- package/dist/validators/inhibitorValidations.d.ts +15 -2
- package/dist/validators/inhibitorValidations.js +1 -1
- package/package.json +1 -1
package/dist/models/Arguments.js
CHANGED
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
export async function messageArguments(message, command) {
|
|
2
|
-
const separator = command.separator || ' ',
|
|
3
|
-
|
|
2
|
+
const separator = command.separator || ' ',
|
|
3
|
+
content = message.content.split(separator).slice(1);
|
|
4
|
+
let args = {},
|
|
5
|
+
flags = {};
|
|
4
6
|
if (command.flags)
|
|
5
7
|
command.flags.map((flag) => {
|
|
6
|
-
if (!flags)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
flags[flag.name] = true;
|
|
10
|
-
else
|
|
11
|
-
flags[flag.name] = false;
|
|
8
|
+
if (!flags) flags = {};
|
|
9
|
+
if (content.includes(flag.match)) flags[flag.name] = true;
|
|
10
|
+
else flags[flag.name] = false;
|
|
12
11
|
const index = content.indexOf(flag.match);
|
|
13
|
-
if (index > 0)
|
|
14
|
-
content.splice(index, 1);
|
|
12
|
+
if (index > 0) content.splice(index, 1);
|
|
15
13
|
});
|
|
16
14
|
if (command.args)
|
|
17
15
|
for (const argument of command.args) {
|
|
18
16
|
const element = content.at(0) || null;
|
|
19
17
|
if (!element) {
|
|
20
|
-
if (typeof argument.default === 'function')
|
|
21
|
-
args[argument.name] = argument.default(message);
|
|
18
|
+
if (typeof argument.default === 'function') args[argument.name] = argument.default(message);
|
|
22
19
|
args[argument.name] = argument.default || null;
|
|
23
20
|
continue;
|
|
24
21
|
}
|
|
25
|
-
if (argument.type === 'option')
|
|
26
|
-
|
|
27
|
-
if (argument.type === '
|
|
28
|
-
|
|
29
|
-
if (argument.type === '
|
|
30
|
-
|
|
31
|
-
if (argument.type === 'boolean')
|
|
32
|
-
args[argument.name] = element === 'true' ? true : false;
|
|
33
|
-
if (argument.type === 'confirm')
|
|
34
|
-
args[argument.name] = element === 'yes' ? 'yes' : 'no';
|
|
35
|
-
if (argument.type === 'string')
|
|
36
|
-
args[argument.name] = element;
|
|
22
|
+
if (argument.type === 'option') argument.match?.includes(element) ? (args[argument.name] = element) : (args[argument.name] = null);
|
|
23
|
+
if (argument.type === 'number') args[argument.name] = parseInt(element);
|
|
24
|
+
if (argument.type === 'integer') args[argument.name] = parseInt(element);
|
|
25
|
+
if (argument.type === 'boolean') args[argument.name] = element === 'true' ? true : false;
|
|
26
|
+
if (argument.type === 'confirm') args[argument.name] = element === 'yes' ? 'yes' : 'no';
|
|
27
|
+
if (argument.type === 'string') args[argument.name] = element;
|
|
37
28
|
if (argument.type === 'channel') {
|
|
38
29
|
try {
|
|
39
30
|
const channel = await message.client.channels.fetch(element);
|
|
40
31
|
args[argument.name] = channel;
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
32
|
+
} catch (e) {
|
|
43
33
|
args[argument.name] = null;
|
|
44
34
|
}
|
|
45
35
|
}
|
|
@@ -47,32 +37,33 @@ export async function messageArguments(message, command) {
|
|
|
47
37
|
try {
|
|
48
38
|
const guild = await message.client.guilds.fetch(element);
|
|
49
39
|
args[argument.name] = guild;
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
40
|
+
} catch (e) {
|
|
52
41
|
args[argument.name] = null;
|
|
53
42
|
}
|
|
54
43
|
}
|
|
55
44
|
if (argument.type === 'mentionable') {
|
|
56
|
-
(
|
|
57
|
-
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
(
|
|
46
|
+
await Promise.all(
|
|
47
|
+
[message.guild?.roles, message.client.users, message.client.guilds, message.client.channels, message.guild?.members, message.channel.messages].map((req) =>
|
|
48
|
+
req
|
|
49
|
+
? req
|
|
50
|
+
.fetch(element)
|
|
51
|
+
.then((r) => r)
|
|
52
|
+
.catch(() => null)
|
|
53
|
+
: null
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
).map((mentionable) => {
|
|
57
|
+
if (!args) args = {};
|
|
58
|
+
if (mentionable) return (args[argument.name] = mentionable);
|
|
59
|
+
else return (args[argument.name] = null);
|
|
68
60
|
});
|
|
69
61
|
}
|
|
70
62
|
if (argument.type === 'role') {
|
|
71
63
|
try {
|
|
72
64
|
const role = await message.guild?.roles.fetch(element);
|
|
73
65
|
args[argument.name] = role;
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
66
|
+
} catch (e) {
|
|
76
67
|
args[argument.name] = null;
|
|
77
68
|
}
|
|
78
69
|
}
|
|
@@ -80,8 +71,7 @@ export async function messageArguments(message, command) {
|
|
|
80
71
|
try {
|
|
81
72
|
const user = await message.client.users.fetch(element);
|
|
82
73
|
args[argument.name] = user;
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
74
|
+
} catch (e) {
|
|
85
75
|
args[argument.name] = null;
|
|
86
76
|
}
|
|
87
77
|
}
|
|
@@ -89,8 +79,7 @@ export async function messageArguments(message, command) {
|
|
|
89
79
|
try {
|
|
90
80
|
const member = await message.guild?.members.fetch(element);
|
|
91
81
|
args[argument.name] = member;
|
|
92
|
-
}
|
|
93
|
-
catch (e) {
|
|
82
|
+
} catch (e) {
|
|
94
83
|
args[argument.name] = null;
|
|
95
84
|
}
|
|
96
85
|
}
|
|
@@ -98,20 +87,18 @@ export async function messageArguments(message, command) {
|
|
|
98
87
|
try {
|
|
99
88
|
const msg = await message.channel?.messages.fetch(element);
|
|
100
89
|
args[argument.name] = msg;
|
|
101
|
-
}
|
|
102
|
-
catch (e) {
|
|
90
|
+
} catch (e) {
|
|
103
91
|
args[argument.name] = null;
|
|
104
92
|
}
|
|
105
93
|
}
|
|
106
94
|
if (argument.type === 'list') {
|
|
107
95
|
let separator = String(argument.separator) || ',';
|
|
108
|
-
if (separator.startsWith('/') && separator.endsWith('/'))
|
|
109
|
-
separator = separator.replace(/^\/|\/$/gim, '');
|
|
96
|
+
if (separator.startsWith('/') && separator.endsWith('/')) separator = separator.replace(/^\/|\/$/gim, '');
|
|
110
97
|
const items = content.join(' ').split(new RegExp(' *' + separator + ' *', 'gi'));
|
|
111
|
-
if (!argument.content)
|
|
112
|
-
args[argument.name] = items;
|
|
98
|
+
if (!argument.content) args[argument.name] = items;
|
|
113
99
|
else {
|
|
114
|
-
const contents = argument.content.map((content) => content.toLowerCase()),
|
|
100
|
+
const contents = argument.content.map((content) => content.toLowerCase()),
|
|
101
|
+
itemList = [];
|
|
115
102
|
items.map((item) => (contents.includes(item.toLowerCase()) ? itemList.push(argument.content?.at(contents.indexOf(item.toLowerCase()))) : null));
|
|
116
103
|
args[argument.name] = itemList;
|
|
117
104
|
break;
|
|
@@ -123,16 +110,16 @@ export async function messageArguments(message, command) {
|
|
|
123
110
|
}
|
|
124
111
|
content.splice(0, 1);
|
|
125
112
|
}
|
|
126
|
-
if (!command.flags)
|
|
127
|
-
|
|
128
|
-
if (!command.args)
|
|
129
|
-
args = null;
|
|
113
|
+
if (!command.flags) flags = null;
|
|
114
|
+
if (!command.args) args = null;
|
|
130
115
|
return { args, flags };
|
|
131
116
|
}
|
|
132
117
|
export async function interactionArguments(interaction, command) {
|
|
133
118
|
if (command.fileType === 'SlashCommand') {
|
|
134
119
|
const options = {};
|
|
135
|
-
let args = interaction?.options?._hoistedOptions,
|
|
120
|
+
let args = interaction?.options?._hoistedOptions,
|
|
121
|
+
group = interaction?.options?._group,
|
|
122
|
+
subcommand = interaction?.options?._subcommand;
|
|
136
123
|
if (interaction.options._hoistedOptions) {
|
|
137
124
|
for (const option of interaction.options._hoistedOptions) {
|
|
138
125
|
options[option.name] = option.member || option.channel || option.user || option.role || option.value;
|
|
@@ -142,10 +129,8 @@ export async function interactionArguments(interaction, command) {
|
|
|
142
129
|
return { args, group, subcommand };
|
|
143
130
|
}
|
|
144
131
|
if (command.fileType === 'ContextCommand') {
|
|
145
|
-
if (command.type === 'user')
|
|
146
|
-
|
|
147
|
-
if (command.type === 'message')
|
|
148
|
-
return await interaction.channel.messages.fetch(interaction.targetId);
|
|
132
|
+
if (command.type === 'user') return await interaction.client.users.fetch(interaction.targetId);
|
|
133
|
+
if (command.type === 'message') return await interaction.channel.messages.fetch(interaction.targetId);
|
|
149
134
|
}
|
|
150
135
|
}
|
|
151
|
-
//# sourceMappingURL=Arguments.js.map
|
|
136
|
+
//# sourceMappingURL=Arguments.js.map
|
package/dist/tools/XernerxLog.js
CHANGED
|
@@ -18,7 +18,12 @@ export default class XernerxLog {
|
|
|
18
18
|
}
|
|
19
19
|
ready() {
|
|
20
20
|
this.client.prependOnceListener('ready', async (synced) => {
|
|
21
|
-
this.info(
|
|
21
|
+
this.info(
|
|
22
|
+
`${synced.user.tag} is now online, watching ${this.client.guilds.cache.size} guilds, using ${
|
|
23
|
+
this.client.settings.local ? await this.client.guilds.fetch(this.client.settings.local) : 'none'
|
|
24
|
+
} as local guild.`,
|
|
25
|
+
this.readyLog
|
|
26
|
+
);
|
|
22
27
|
const files = [];
|
|
23
28
|
for (const [id, data] of this.client.commands.message) {
|
|
24
29
|
files.push(data);
|
|
@@ -46,4 +51,4 @@ export default class XernerxLog {
|
|
|
46
51
|
});
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
|
-
//# sourceMappingURL=XernerxLog.js.map
|
|
54
|
+
//# sourceMappingURL=XernerxLog.js.map
|
|
@@ -8,14 +8,10 @@ export interface XernerxUser extends User {
|
|
|
8
8
|
export interface XernerxMember extends GuildMember {
|
|
9
9
|
username: string;
|
|
10
10
|
}
|
|
11
|
-
export interface XernerxGuild extends Guild {
|
|
12
|
-
}
|
|
13
|
-
export interface
|
|
14
|
-
}
|
|
15
|
-
export interface XernerxDMChannel extends DMChannel {
|
|
16
|
-
}
|
|
17
|
-
interface XernerxCommand {
|
|
18
|
-
}
|
|
11
|
+
export interface XernerxGuild extends Guild {}
|
|
12
|
+
export interface XernerxGuildChannel extends GuildChannel {}
|
|
13
|
+
export interface XernerxDMChannel extends DMChannel {}
|
|
14
|
+
interface XernerxCommand {}
|
|
19
15
|
export interface XernerxMessage extends Message, XernerxCommand {
|
|
20
16
|
user: XernerxUser;
|
|
21
17
|
util: MessageUtil;
|
|
@@ -30,4 +26,4 @@ export interface XernerxMessageContextInteraction extends MessageContextMenuComm
|
|
|
30
26
|
util: InteractionUtil;
|
|
31
27
|
}
|
|
32
28
|
export {};
|
|
33
|
-
//# sourceMappingURL=extenders.d.ts.map
|
|
29
|
+
//# sourceMappingURL=extenders.d.ts.map
|
package/dist/types/extenders.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=extenders.js.map
|
|
2
|
+
//# sourceMappingURL=extenders.js.map
|
|
@@ -67,11 +67,14 @@ export interface DBLOptions {
|
|
|
67
67
|
}
|
|
68
68
|
export interface XernerxCache {
|
|
69
69
|
messages: Collection<string, string>;
|
|
70
|
-
cooldowns: Collection<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
cooldowns: Collection<
|
|
71
|
+
string,
|
|
72
|
+
{
|
|
73
|
+
id: string;
|
|
74
|
+
command: string;
|
|
75
|
+
createdTimestamp: number;
|
|
76
|
+
}
|
|
77
|
+
>;
|
|
75
78
|
}
|
|
76
79
|
interface CommandHandlerOptions {
|
|
77
80
|
directory: string;
|
|
@@ -228,4 +231,4 @@ export interface PresenceOptions {
|
|
|
228
231
|
interval?: number;
|
|
229
232
|
}
|
|
230
233
|
export {};
|
|
231
|
-
//# sourceMappingURL=interfaces.d.ts.map
|
|
234
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
package/dist/types/interfaces.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=interfaces.js.map
|
|
2
|
+
//# sourceMappingURL=interfaces.js.map
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,14 +1,182 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
SlashCommandBooleanOption,
|
|
3
|
+
SlashCommandChannelOption,
|
|
4
|
+
SlashCommandIntegerOption,
|
|
5
|
+
SlashCommandMentionableOption,
|
|
6
|
+
SlashCommandNumberOption,
|
|
7
|
+
SlashCommandRoleOption,
|
|
8
|
+
SlashCommandStringOption,
|
|
9
|
+
SlashCommandUserOption,
|
|
10
|
+
} from 'discord.js';
|
|
2
11
|
import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from './extenders.js';
|
|
3
12
|
export type FileType = 'MessageCommand' | 'SlashCommand' | 'ContextCommand' | 'Event' | 'Inhibitor';
|
|
4
|
-
export type Locales =
|
|
13
|
+
export type Locales =
|
|
14
|
+
| 'en-US'
|
|
15
|
+
| 'en-GB'
|
|
16
|
+
| 'bg'
|
|
17
|
+
| 'zh-CN'
|
|
18
|
+
| 'zh-TW'
|
|
19
|
+
| 'hr'
|
|
20
|
+
| 'cs'
|
|
21
|
+
| 'da'
|
|
22
|
+
| 'nl'
|
|
23
|
+
| 'fi'
|
|
24
|
+
| 'fr'
|
|
25
|
+
| 'de'
|
|
26
|
+
| 'el'
|
|
27
|
+
| 'hi'
|
|
28
|
+
| 'hu'
|
|
29
|
+
| 'it'
|
|
30
|
+
| 'ja'
|
|
31
|
+
| 'ko'
|
|
32
|
+
| 'lt'
|
|
33
|
+
| 'no'
|
|
34
|
+
| 'pl'
|
|
35
|
+
| 'pt-BR'
|
|
36
|
+
| 'ro'
|
|
37
|
+
| 'ru'
|
|
38
|
+
| 'es-ES'
|
|
39
|
+
| 'sv-SE'
|
|
40
|
+
| 'th'
|
|
41
|
+
| 'tr'
|
|
42
|
+
| 'uk'
|
|
43
|
+
| 'vi';
|
|
5
44
|
export type SlashCommandArgumentType = 'attachment' | 'boolean' | 'channel' | 'integer' | 'mentionable' | 'number' | 'role' | 'string' | 'user';
|
|
6
45
|
export type SlashCommandOptionChoices = SlashCommandStringOption | SlashCommandNumberOption | SlashCommandIntegerOption;
|
|
7
46
|
export type SlashCommandOption = SlashCommandOptionChoices | SlashCommandBooleanOption | SlashCommandUserOption | SlashCommandChannelOption | SlashCommandRoleOption | SlashCommandMentionableOption;
|
|
8
|
-
export type MessageCommandArgumentType =
|
|
9
|
-
|
|
47
|
+
export type MessageCommandArgumentType =
|
|
48
|
+
| 'string'
|
|
49
|
+
| 'number'
|
|
50
|
+
| 'boolean'
|
|
51
|
+
| 'confirm'
|
|
52
|
+
| 'channel'
|
|
53
|
+
| 'guild'
|
|
54
|
+
| 'integer'
|
|
55
|
+
| 'mentionable'
|
|
56
|
+
| 'role'
|
|
57
|
+
| 'user'
|
|
58
|
+
| 'message'
|
|
59
|
+
| 'member'
|
|
60
|
+
| 'list'
|
|
61
|
+
| 'option'
|
|
62
|
+
| 'rest';
|
|
63
|
+
export type DiscordEventType =
|
|
64
|
+
| 'applicationCommandPermissionsUpdate'
|
|
65
|
+
| 'autoModerationActionExecution'
|
|
66
|
+
| 'autoModerationRuleCreate'
|
|
67
|
+
| 'autoModerationRuleDelete'
|
|
68
|
+
| 'autoModerationRuleUpdate'
|
|
69
|
+
| 'ready'
|
|
70
|
+
| 'guildCreate'
|
|
71
|
+
| 'guildDelete'
|
|
72
|
+
| 'guildUpdate'
|
|
73
|
+
| 'guildUnavailable'
|
|
74
|
+
| 'guildMemberAdd'
|
|
75
|
+
| 'guildMemberRemove'
|
|
76
|
+
| 'guildMemberUpdate'
|
|
77
|
+
| 'guildMemberAvailable'
|
|
78
|
+
| 'guildMembersChunk'
|
|
79
|
+
| 'guildIntegrationsUpdate'
|
|
80
|
+
| 'roleCreate'
|
|
81
|
+
| 'roleDelete'
|
|
82
|
+
| 'inviteCreate'
|
|
83
|
+
| 'inviteDelete'
|
|
84
|
+
| 'roleUpdate'
|
|
85
|
+
| 'emojiCreate'
|
|
86
|
+
| 'emojiDelete'
|
|
87
|
+
| 'emojiUpdate'
|
|
88
|
+
| 'guildBanAdd'
|
|
89
|
+
| 'guildBanRemove'
|
|
90
|
+
| 'channelCreate'
|
|
91
|
+
| 'channelDelete'
|
|
92
|
+
| 'channelUpdate'
|
|
93
|
+
| 'channelPinsUpdate'
|
|
94
|
+
| 'messageCreate'
|
|
95
|
+
| 'messageDelete'
|
|
96
|
+
| 'messageUpdate'
|
|
97
|
+
| 'messageDeleteBulk'
|
|
98
|
+
| 'messageReactionAdd'
|
|
99
|
+
| 'messageReactionRemove'
|
|
100
|
+
| 'messageReactionRemoveAll'
|
|
101
|
+
| 'messageReactionRemoveEmoji'
|
|
102
|
+
| 'threadCreate'
|
|
103
|
+
| 'threadDelete'
|
|
104
|
+
| 'threadUpdate'
|
|
105
|
+
| 'threadListSync'
|
|
106
|
+
| 'threadMemberUpdate'
|
|
107
|
+
| 'threadMembersUpdate'
|
|
108
|
+
| 'userUpdate'
|
|
109
|
+
| 'presenceUpdate'
|
|
110
|
+
| 'voiceServerUpdate'
|
|
111
|
+
| 'voiceStateUpdate'
|
|
112
|
+
| 'typingStart'
|
|
113
|
+
| 'webhookUpdate'
|
|
114
|
+
| 'interactionCreate'
|
|
115
|
+
| 'error'
|
|
116
|
+
| 'warn'
|
|
117
|
+
| 'debug'
|
|
118
|
+
| 'cacheSweep'
|
|
119
|
+
| 'shardDisconnect'
|
|
120
|
+
| 'shardError'
|
|
121
|
+
| 'shardReconnecting'
|
|
122
|
+
| 'shardReady'
|
|
123
|
+
| 'shardResume'
|
|
124
|
+
| 'invalidated'
|
|
125
|
+
| 'raw'
|
|
126
|
+
| 'stageInstanceCreate'
|
|
127
|
+
| 'stageInstanceUpdate'
|
|
128
|
+
| 'stageInstanceDelete'
|
|
129
|
+
| 'stickerCreate'
|
|
130
|
+
| 'stickerDelete'
|
|
131
|
+
| 'stickerUpdate'
|
|
132
|
+
| 'guildScheduledEventCreate'
|
|
133
|
+
| 'guildScheduledEventUpdate'
|
|
134
|
+
| 'guildScheduledEventDelete'
|
|
135
|
+
| 'guildScheduledEventUserAdd'
|
|
136
|
+
| 'guildScheduledEventUserRemove';
|
|
10
137
|
export type EventType = DiscordEventType | 'webhookCreate' | 'webhookError' | 'commandBlock' | 'commandError' | 'commandStart' | 'commandFinish' | 'commandCooldown';
|
|
11
138
|
export type XernerxInteraction = XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction;
|
|
12
|
-
export type PermissionNames =
|
|
139
|
+
export type PermissionNames =
|
|
140
|
+
| 'create instant invite'
|
|
141
|
+
| 'kick members'
|
|
142
|
+
| 'ban members'
|
|
143
|
+
| 'administrator'
|
|
144
|
+
| 'manage channels'
|
|
145
|
+
| 'manage guild'
|
|
146
|
+
| 'add reactions'
|
|
147
|
+
| 'view audit log'
|
|
148
|
+
| 'priority speaker'
|
|
149
|
+
| 'stream'
|
|
150
|
+
| 'view channel'
|
|
151
|
+
| 'send messages'
|
|
152
|
+
| 'send tts messages'
|
|
153
|
+
| 'manage messages'
|
|
154
|
+
| 'embed links'
|
|
155
|
+
| 'attach files'
|
|
156
|
+
| 'read message history'
|
|
157
|
+
| 'mention everyone'
|
|
158
|
+
| 'use external emojis'
|
|
159
|
+
| 'view guild insights'
|
|
160
|
+
| 'connect'
|
|
161
|
+
| 'speak'
|
|
162
|
+
| 'mute members'
|
|
163
|
+
| 'deafen members'
|
|
164
|
+
| 'move members'
|
|
165
|
+
| 'use vad'
|
|
166
|
+
| 'change nickname'
|
|
167
|
+
| 'manage nicknames'
|
|
168
|
+
| 'manage roles'
|
|
169
|
+
| 'manage webhooks'
|
|
170
|
+
| 'manage emojis and stickers'
|
|
171
|
+
| 'use application commands'
|
|
172
|
+
| 'request to speak'
|
|
173
|
+
| 'manage events'
|
|
174
|
+
| 'manage threads'
|
|
175
|
+
| 'create public threads'
|
|
176
|
+
| 'create private threads'
|
|
177
|
+
| 'use external stickers'
|
|
178
|
+
| 'send messages in threads'
|
|
179
|
+
| 'start embedded activities'
|
|
180
|
+
| 'moderate members';
|
|
13
181
|
export type InhibitorType = 'message' | 'interaction' | 'command' | 'channel' | 'user' | 'member' | 'guild' | 'contextCommand' | 'messageCommand' | 'slashCommand';
|
|
14
|
-
//# sourceMappingURL=types.d.ts.map
|
|
182
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/types/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -4,8 +4,8 @@ import Util from './Util.js';
|
|
|
4
4
|
export default class ClientUtil extends Util {
|
|
5
5
|
hasVoted?: Function;
|
|
6
6
|
constructor(client: XernerxClient);
|
|
7
|
-
setPresence(options: PresenceOptions): import(
|
|
8
|
-
resolveChannel(query: string | Record<string, string>): Promise<import(
|
|
9
|
-
resolveGuild(query: string | Record<string, string>): Promise<import(
|
|
7
|
+
setPresence(options: PresenceOptions): import('discord.js').ClientPresence | undefined;
|
|
8
|
+
resolveChannel(query: string | Record<string, string>): Promise<import('discord.js').Channel | null>;
|
|
9
|
+
resolveGuild(query: string | Record<string, string>): Promise<import('discord.js').Guild | null>;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=ClientUtil.d.ts.map
|
|
11
|
+
//# sourceMappingURL=ClientUtil.d.ts.map
|
package/dist/utils/ClientUtil.js
CHANGED
|
@@ -8,30 +8,24 @@ export default class ClientUtil extends Util {
|
|
|
8
8
|
return setPresence(this.client, options);
|
|
9
9
|
}
|
|
10
10
|
async resolveChannel(query) {
|
|
11
|
-
if (typeof query == 'object')
|
|
12
|
-
query = query.id;
|
|
11
|
+
if (typeof query == 'object') query = query.id;
|
|
13
12
|
try {
|
|
14
|
-
let channel = this.client.channels.cache.find((channel) => channel.name == query.toLowerCase() || channel.id == query.toLowerCase() ? channel : null) || null;
|
|
15
|
-
if (!channel)
|
|
16
|
-
channel = (await this.client.channels.fetch(query)) || null;
|
|
13
|
+
let channel = this.client.channels.cache.find((channel) => (channel.name == query.toLowerCase() || channel.id == query.toLowerCase() ? channel : null)) || null;
|
|
14
|
+
if (!channel) channel = (await this.client.channels.fetch(query)) || null;
|
|
17
15
|
return channel;
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
16
|
+
} catch {
|
|
20
17
|
return null;
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
async resolveGuild(query) {
|
|
24
|
-
if (typeof query == 'object')
|
|
25
|
-
query = query.id;
|
|
21
|
+
if (typeof query == 'object') query = query.id;
|
|
26
22
|
try {
|
|
27
23
|
let guild = this.client.guilds.cache.find((guild) => guild.name.toLowerCase() == query.toLowerCase()) || null;
|
|
28
|
-
if (!guild)
|
|
29
|
-
guild = (await this.client.guilds.fetch(query)) || null;
|
|
24
|
+
if (!guild) guild = (await this.client.guilds.fetch(query)) || null;
|
|
30
25
|
return guild;
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
26
|
+
} catch {
|
|
33
27
|
return null;
|
|
34
28
|
}
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
|
-
//# sourceMappingURL=ClientUtil.js.map
|
|
31
|
+
//# sourceMappingURL=ClientUtil.js.map
|
|
@@ -5,7 +5,7 @@ import Util from './Util.js';
|
|
|
5
5
|
export default class InteractionUtil extends Util {
|
|
6
6
|
private interaction;
|
|
7
7
|
constructor(client: XernerxClient, interaction: XernerxInteraction);
|
|
8
|
-
reply(content: string | MessagePayload | InteractionReplyOptions | InteractionEditReplyOptions): Promise<import(
|
|
8
|
+
reply(content: string | MessagePayload | InteractionReplyOptions | InteractionEditReplyOptions): Promise<import('discord.js').Message<boolean> | import('discord.js').InteractionResponse<boolean>>;
|
|
9
9
|
delay(time: number): Promise<unknown>;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=InteractionUtil.d.ts.map
|
|
11
|
+
//# sourceMappingURL=InteractionUtil.d.ts.map
|
|
@@ -9,8 +9,8 @@ export default class MessageUtil extends Util {
|
|
|
9
9
|
prefix: null | string;
|
|
10
10
|
};
|
|
11
11
|
constructor(client: XernerxClient, message: XernerxMessage);
|
|
12
|
-
reply(content: string | MessagePayload | MessageReplyOptions | MessageEditOptions): Promise<import(
|
|
12
|
+
reply(content: string | MessagePayload | MessageReplyOptions | MessageEditOptions): Promise<import('discord.js').Message<boolean> | null>;
|
|
13
13
|
webhookReply(content: MessagePayload, url?: URL, user?: User): Promise<void>;
|
|
14
14
|
delay(time: number): Promise<unknown>;
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=MessageUtil.d.ts.map
|
|
16
|
+
//# sourceMappingURL=MessageUtil.d.ts.map
|
|
@@ -16,8 +16,7 @@ export default class MessageUtil extends Util {
|
|
|
16
16
|
async reply(content) {
|
|
17
17
|
if (this.client.cache.messages.has(this.message.id)) {
|
|
18
18
|
const id = this.client.cache.messages.get(this.message.id);
|
|
19
|
-
if (!id)
|
|
20
|
-
return null;
|
|
19
|
+
if (!id) return null;
|
|
21
20
|
const msg = await this.message.channel.messages.fetch(id);
|
|
22
21
|
msg.edit(content);
|
|
23
22
|
return msg;
|
|
@@ -27,8 +26,7 @@ export default class MessageUtil extends Util {
|
|
|
27
26
|
return msg;
|
|
28
27
|
}
|
|
29
28
|
async webhookReply(content, url, user) {
|
|
30
|
-
if (this.message.channel.type === ChannelType.DM)
|
|
31
|
-
throw new XernerxError(`Can't use this method in DM Channels`);
|
|
29
|
+
if (this.message.channel.type === ChannelType.DM) throw new XernerxError(`Can't use this method in DM Channels`);
|
|
32
30
|
const channel = this.message.channel;
|
|
33
31
|
let webhook;
|
|
34
32
|
if (!url) {
|
|
@@ -37,15 +35,13 @@ export default class MessageUtil extends Util {
|
|
|
37
35
|
avatar: user?.avatarURL() || this.client.user?.avatarURL(),
|
|
38
36
|
});
|
|
39
37
|
}
|
|
40
|
-
if (!webhook)
|
|
41
|
-
webhook = { url };
|
|
38
|
+
if (!webhook) webhook = { url };
|
|
42
39
|
await sendWebhook(webhook.url, content);
|
|
43
|
-
if (!url)
|
|
44
|
-
webhook.delete();
|
|
40
|
+
if (!url) webhook.delete();
|
|
45
41
|
return;
|
|
46
42
|
}
|
|
47
43
|
async delay(time) {
|
|
48
44
|
return await delay(time);
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
|
-
//# sourceMappingURL=MessageUtil.js.map
|
|
47
|
+
//# sourceMappingURL=MessageUtil.js.map
|
package/dist/utils/Util.d.ts
CHANGED
package/dist/utils/Util.js
CHANGED
|
@@ -4,4 +4,4 @@ import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
|
|
|
4
4
|
import { XernerxMessage } from '../types/extenders.js';
|
|
5
5
|
import { XernerxInteraction } from '../types/types.js';
|
|
6
6
|
export default function commandValidation(event: XernerxInteraction | XernerxMessage, command: MessageCommandBuilder | SlashCommandBuilder | ContextCommandBuilder): Promise<boolean>;
|
|
7
|
-
//# sourceMappingURL=commandValidation.d.ts.map
|
|
7
|
+
//# sourceMappingURL=commandValidation.d.ts.map
|