xernerx 4.17.3 → 4.17.5
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/XernerxContextCommand.d.ts +75 -47
- package/dist/build/XernerxContextCommand.js +119 -115
- package/dist/build/XernerxEvent.d.ts +10 -10
- package/dist/build/XernerxEvent.js +17 -17
- package/dist/build/XernerxInhibitor.d.ts +39 -15
- package/dist/build/XernerxInhibitor.js +18 -18
- package/dist/build/XernerxMessageCommand.d.ts +78 -52
- package/dist/build/XernerxMessageCommand.js +118 -114
- package/dist/build/XernerxSlashCommand.d.ts +96 -62
- package/dist/build/XernerxSlashCommand.js +176 -172
- package/dist/client/XernerxClient.d.ts +55 -45
- package/dist/client/XernerxClient.js +83 -88
- package/dist/client/XernerxShardClient.d.ts +14 -14
- package/dist/client/XernerxShardClient.js +61 -47
- package/dist/functions/deploy.js +45 -52
- package/dist/functions/load.js +28 -29
- package/dist/functions/reload.js +23 -24
- package/dist/functions/setPresence.d.ts +1 -1
- package/dist/functions/setPresence.js +17 -16
- package/dist/functions/xernerxUser.js +5 -6
- package/dist/handlers/CommandHandler.d.ts +10 -10
- package/dist/handlers/CommandHandler.js +311 -336
- package/dist/handlers/EventHandler.d.ts +3 -3
- package/dist/handlers/EventHandler.js +48 -21
- package/dist/handlers/ExtensionHandler.d.ts +3 -3
- package/dist/handlers/ExtensionHandler.js +23 -23
- package/dist/handlers/Handler.d.ts +19 -14
- package/dist/handlers/Handler.js +46 -50
- package/dist/handlers/InhibitorHandler.d.ts +3 -3
- package/dist/handlers/InhibitorHandler.js +25 -23
- package/dist/handlers/IntegrationHandler.d.ts +6 -6
- package/dist/handlers/IntegrationHandler.js +20 -20
- package/dist/main.d.ts +28 -21
- package/dist/main.js +28 -21
- package/dist/models/Arguments.d.ts +4 -1
- package/dist/models/Arguments.js +134 -149
- package/dist/models/Cooldowns.d.ts +6 -6
- package/dist/models/Cooldowns.js +25 -29
- package/dist/tools/XernerxError.d.ts +4 -4
- package/dist/tools/XernerxError.js +8 -8
- package/dist/tools/XernerxIntents.d.ts +2 -2
- package/dist/tools/XernerxIntents.js +21 -21
- package/dist/tools/XernerxLog.d.ts +23 -23
- package/dist/tools/XernerxLog.js +125 -110
- package/dist/tools/XernerxText.d.ts +23 -23
- package/dist/tools/XernerxText.js +79 -89
- package/dist/types/extenders.d.ts +55 -47
- package/dist/types/interfaces.d.ts +192 -189
- package/dist/types/types.d.ts +104 -5
- package/dist/utils/ClientUtil.d.ts +12 -9
- package/dist/utils/ClientUtil.js +96 -79
- package/dist/utils/InteractionUtil.d.ts +13 -13
- package/dist/utils/InteractionUtil.js +148 -147
- package/dist/utils/MessageUtil.d.ts +14 -14
- package/dist/utils/MessageUtil.js +162 -161
- package/dist/utils/Util.d.ts +4 -4
- package/dist/utils/Util.js +7 -7
- package/dist/validators/commandValidation.d.ts +4 -1
- package/dist/validators/commandValidation.js +157 -114
- package/dist/validators/inhibitorValidations.d.ts +21 -2
- package/dist/validators/inhibitorValidations.js +39 -39
- package/package.json +3 -3
package/dist/tools/XernerxLog.js
CHANGED
|
@@ -6,114 +6,129 @@ import { version } from '../main.js';
|
|
|
6
6
|
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
|
|
7
7
|
let i = 0;
|
|
8
8
|
export default class XernerxLog {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
9
|
+
constructor(client) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
if (client == true || (typeof client.settings.log == 'boolean' && client.settings.log)) {
|
|
12
|
+
this.errorLog = true;
|
|
13
|
+
this.infoLog = true;
|
|
14
|
+
this.warnLog = true;
|
|
15
|
+
this.format = ['ram', 'time'];
|
|
16
|
+
} else {
|
|
17
|
+
this.errorLog = client.settings.log?.error;
|
|
18
|
+
this.infoLog = client.settings.log?.info;
|
|
19
|
+
this.warnLog = client.settings.log?.warn;
|
|
20
|
+
this.readyLog = client.settings.log?.ready;
|
|
21
|
+
this.tableLog = client.settings.log?.table;
|
|
22
|
+
this.format = client.settings.log?.format || ['ram', 'time'];
|
|
23
|
+
}
|
|
24
|
+
const format = {
|
|
25
|
+
name: this.blue(pkg.name),
|
|
26
|
+
node: this.green(process.version),
|
|
27
|
+
xernerx: this.cyan(version),
|
|
28
|
+
discordjs: this.cyan(Discord.version),
|
|
29
|
+
platform: this.green(process.platform),
|
|
30
|
+
time: () => this.cyan(new Date().toLocaleTimeString()),
|
|
31
|
+
date: () => this.cyan(new Date().toLocaleDateString()),
|
|
32
|
+
ram: () => `${this.cyan(Math.round(process.memoryUsage().rss / 1000000))}mb`,
|
|
33
|
+
version: this.cyan(pkg.version),
|
|
34
|
+
author: this.blue(pkg.author),
|
|
35
|
+
shard: this.cyan(''),
|
|
36
|
+
index: () => {
|
|
37
|
+
i++;
|
|
38
|
+
return i;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
process.on('message', (message) => {
|
|
42
|
+
if (message.type == 'xernerx') format.shard = message?.data?.sharded ? `| ${message?.data?.shardId} |` : '';
|
|
43
|
+
});
|
|
44
|
+
this.base = (type, message) =>
|
|
45
|
+
`${
|
|
46
|
+
type == 'info' ? `✔️ | ${this.purple('Xernerx')}` : type == `error` ? `❗ | ${this.red('Xernerx')}` : type == `update` ? `⬆️ | ${this.blue('Xernerx')}` : `⚠️ | ${this.yellow('Xernerx')}`
|
|
47
|
+
} | ${this.format
|
|
48
|
+
?.map((c) => (typeof format[c] == 'function' ? format[c]() : format[c]) || null)
|
|
49
|
+
.filter((x) => x)
|
|
50
|
+
.join(' | ')} | ${message}`;
|
|
51
|
+
}
|
|
52
|
+
info(message, force = false) {
|
|
53
|
+
return this.infoLog || force ? console.info(this.base('info', message)) : null;
|
|
54
|
+
}
|
|
55
|
+
warn(message) {
|
|
56
|
+
return this.warnLog ? console.warn(this.base('warn', message)) : null;
|
|
57
|
+
}
|
|
58
|
+
async update(version, url) {
|
|
59
|
+
try {
|
|
60
|
+
const pkg = await fetch(url)
|
|
61
|
+
.then(async (res) => await res.json())
|
|
62
|
+
.catch(() => ({ version }));
|
|
63
|
+
if (version !== pkg.version)
|
|
64
|
+
console.info(
|
|
65
|
+
this.base(
|
|
66
|
+
'update',
|
|
67
|
+
`A new version for ${pkg.name} is available, you're using version ${this.cyan(version)}, new version is ${this.cyan(pkg.version)}, run ${Style.log(`npm i ${pkg.name}@${pkg.version}`, {
|
|
68
|
+
color: Style.BackgroundColor.Grey,
|
|
69
|
+
})} to update to the latest version.`
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.warn(this.base('error', `An error occured while trying to check for a new version for ${pkg.name}, please try again later.`));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
error(message, error) {
|
|
77
|
+
return this.errorLog ? console.error(this.base('error', message), error || '') : null;
|
|
78
|
+
}
|
|
79
|
+
ready() {
|
|
80
|
+
if (typeof this.client == 'boolean') return;
|
|
81
|
+
const client = this.client;
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
this.client.prependOnceListener('ready', async (synced) => {
|
|
84
|
+
this.info(
|
|
85
|
+
`${Style.log(synced.user.tag, { color: Style.TextColor.Blue })} is now ${this.green('online')}, watching ${this.cyan(String(client.guilds.cache.size))} guild${
|
|
86
|
+
client.guilds.cache.size > 1 ? 's' : ''
|
|
87
|
+
}, using ${client.settings.local ? this.blue((await client.guilds.fetch(client.settings.local))?.name) : 'none'} as local guild.`,
|
|
88
|
+
this.readyLog
|
|
89
|
+
);
|
|
90
|
+
const files = [];
|
|
91
|
+
for (const [id, data] of client.commands.message) {
|
|
92
|
+
files.push(data);
|
|
93
|
+
id;
|
|
94
|
+
}
|
|
95
|
+
for (const [id, data] of client.commands.slash) {
|
|
96
|
+
files.push(data);
|
|
97
|
+
id;
|
|
98
|
+
}
|
|
99
|
+
for (const [id, data] of client.commands.context) {
|
|
100
|
+
files.push(data);
|
|
101
|
+
id;
|
|
102
|
+
}
|
|
103
|
+
for (const [id, data] of client.events) {
|
|
104
|
+
files.push(data);
|
|
105
|
+
id;
|
|
106
|
+
}
|
|
107
|
+
for (const [id, data] of client.inhibitors) {
|
|
108
|
+
files.push(data);
|
|
109
|
+
id;
|
|
110
|
+
}
|
|
111
|
+
if (this.tableLog) {
|
|
112
|
+
console.table(files, this.tableLog);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
cyan(string) {
|
|
117
|
+
return Style.log(String(string), { color: Style.TextColor.Cyan });
|
|
118
|
+
}
|
|
119
|
+
blue(string) {
|
|
120
|
+
return Style.log(String(string), { color: Style.TextColor.Blue });
|
|
121
|
+
}
|
|
122
|
+
yellow(string) {
|
|
123
|
+
return Style.log(String(string), { color: Style.TextColor.Yellow });
|
|
124
|
+
}
|
|
125
|
+
purple(string) {
|
|
126
|
+
return Style.log(String(string), { color: Style.TextColor.Purple });
|
|
127
|
+
}
|
|
128
|
+
red(string) {
|
|
129
|
+
return Style.log(String(string), { color: Style.TextColor.Red });
|
|
130
|
+
}
|
|
131
|
+
green(string) {
|
|
132
|
+
return Style.log(String(string), { color: Style.TextColor.Green });
|
|
133
|
+
}
|
|
119
134
|
}
|
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
import { Emoji, Role } from 'discord.js';
|
|
3
3
|
import { XernerxGuildChannel, XernerxMember, XernerxUser } from '../types/extenders.js';
|
|
4
4
|
export default class XernerxText {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
user(user: string | XernerxUser): string;
|
|
6
|
+
channel(channel: string | XernerxGuildChannel): string;
|
|
7
|
+
role(role: string | Role): string;
|
|
8
|
+
emoji(emoji: string | Emoji, animated?: boolean): string;
|
|
9
|
+
member(member: string | XernerxMember): string;
|
|
10
|
+
command(id: string, name: string): string | null;
|
|
11
|
+
timestamp(timestamp?: number | Date, format?: 't' | 'T' | 'd' | 'D' | 'f' | 'F' | 'R'): string;
|
|
12
|
+
codeBlock(code: string, language: string): string;
|
|
13
|
+
iCodeBlock(code: string): string;
|
|
14
|
+
bold(text: string): string;
|
|
15
|
+
italic(text: string): string;
|
|
16
|
+
underline(text: string): string;
|
|
17
|
+
strike(text: string): string;
|
|
18
|
+
spoiler(text: string): string;
|
|
19
|
+
quote(text: string): string;
|
|
20
|
+
blockQuote(text: string): string;
|
|
21
|
+
hyperlink(text: string, url: string): string;
|
|
22
|
+
Progressbar(min: number, max: number, cur: number, options?: ProgressBarOptions): string;
|
|
23
23
|
}
|
|
24
24
|
interface ProgressBarOptions {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
fill?: string;
|
|
26
|
+
fade?: string;
|
|
27
|
+
empty?: string;
|
|
28
|
+
percentage?: boolean;
|
|
29
|
+
length?: number;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
@@ -1,94 +1,84 @@
|
|
|
1
1
|
/** @format */
|
|
2
2
|
export default class XernerxText {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (typeof timestamp == 'string')
|
|
35
|
-
timestamp = Number(timestamp);
|
|
36
|
-
if (isNaN(timestamp))
|
|
37
|
-
return 'Invalid Date';
|
|
38
|
-
return `<t:${timestamp}:${format}>`;
|
|
39
|
-
}
|
|
40
|
-
codeBlock(code, language) {
|
|
41
|
-
return `\`\`\`${language}
|
|
3
|
+
user(user) {
|
|
4
|
+
if (typeof user == 'object') user = user.id;
|
|
5
|
+
return `<@${user}>`;
|
|
6
|
+
}
|
|
7
|
+
channel(channel) {
|
|
8
|
+
if (typeof channel == 'object') channel = channel.id;
|
|
9
|
+
return `<#${channel}>`;
|
|
10
|
+
}
|
|
11
|
+
role(role) {
|
|
12
|
+
if (typeof role == 'object') role = role.id;
|
|
13
|
+
return `<@&${role}>`;
|
|
14
|
+
}
|
|
15
|
+
emoji(emoji, animated = false) {
|
|
16
|
+
if (typeof emoji == 'object') emoji = emoji.id;
|
|
17
|
+
return `<${animated ? 'a' : ''}:${emoji}>`;
|
|
18
|
+
}
|
|
19
|
+
member(member) {
|
|
20
|
+
if (typeof member == 'object') member = member.id;
|
|
21
|
+
return `<@!${member}>`;
|
|
22
|
+
}
|
|
23
|
+
command(id, name) {
|
|
24
|
+
if (typeof id !== 'string') return null;
|
|
25
|
+
return `</${name}:${id}>`;
|
|
26
|
+
}
|
|
27
|
+
timestamp(timestamp = Date.now(), format = 'R') {
|
|
28
|
+
if (typeof timestamp == 'string') timestamp = Number(timestamp);
|
|
29
|
+
if (isNaN(timestamp)) return 'Invalid Date';
|
|
30
|
+
return `<t:${timestamp}:${format}>`;
|
|
31
|
+
}
|
|
32
|
+
codeBlock(code, language) {
|
|
33
|
+
return `\`\`\`${language}
|
|
42
34
|
${code}
|
|
43
35
|
\`\`\``;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return '`' + options.fill.repeat(filledLength) + options.empty.repeat(emptyLength) + '` ' + `\`${percentage * 100}%\``;
|
|
93
|
-
}
|
|
36
|
+
}
|
|
37
|
+
iCodeBlock(code) {
|
|
38
|
+
return `\`${code}\``;
|
|
39
|
+
}
|
|
40
|
+
bold(text) {
|
|
41
|
+
return `**${text}**`;
|
|
42
|
+
}
|
|
43
|
+
italic(text) {
|
|
44
|
+
return `*${text}*`;
|
|
45
|
+
}
|
|
46
|
+
underline(text) {
|
|
47
|
+
return `__${text}__`;
|
|
48
|
+
}
|
|
49
|
+
strike(text) {
|
|
50
|
+
return `~~${text}~~`;
|
|
51
|
+
}
|
|
52
|
+
spoiler(text) {
|
|
53
|
+
return `||${text}||`;
|
|
54
|
+
}
|
|
55
|
+
quote(text) {
|
|
56
|
+
return `> ${text}`;
|
|
57
|
+
}
|
|
58
|
+
blockQuote(text) {
|
|
59
|
+
return `>>> ${text}`;
|
|
60
|
+
}
|
|
61
|
+
hyperlink(text, url) {
|
|
62
|
+
return `[${text}](${url})`;
|
|
63
|
+
}
|
|
64
|
+
// public static HyperlinkWithTooltip(text: string, url: string, tooltip: string) {
|
|
65
|
+
// return `[${text}](${url} "${tooltip}")`;
|
|
66
|
+
// }
|
|
67
|
+
// public static HyperlinkWithTooltipAndImage(text: string, url: string, tooltip: string, imageUrl: string) {
|
|
68
|
+
// return `[${text}](${url} "${tooltip}":${imageUrl})`;
|
|
69
|
+
// }
|
|
70
|
+
// public static HyperlinkWithImage(text: string, url: string, imageUrl: string) {
|
|
71
|
+
// return `[${text}](${url}:${imageUrl})`;
|
|
72
|
+
// }
|
|
73
|
+
Progressbar(min, max, cur, options = {}) {
|
|
74
|
+
if (!options.fill) options.fill = '█';
|
|
75
|
+
if (!options.fade) options.fade = '▓▒';
|
|
76
|
+
if (!options.empty) options.empty = '░';
|
|
77
|
+
const length = options.length || 20,
|
|
78
|
+
percentage = cur / max,
|
|
79
|
+
filledLength = Math.round(length * percentage),
|
|
80
|
+
emptyLength = length - filledLength;
|
|
81
|
+
if (!options.percentage) return '`' + options.fill.repeat(filledLength) + options.empty.repeat(emptyLength) + '`';
|
|
82
|
+
else return '`' + options.fill.repeat(filledLength) + options.empty.repeat(emptyLength) + '` ' + `\`${percentage * 100}%\``;
|
|
83
|
+
}
|
|
94
84
|
}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
/** @format */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ChatInputCommandInteraction,
|
|
4
|
+
Collection,
|
|
5
|
+
DMChannel,
|
|
6
|
+
Guild,
|
|
7
|
+
GuildChannel,
|
|
8
|
+
GuildMember,
|
|
9
|
+
Message,
|
|
10
|
+
MessageContextMenuCommandInteraction,
|
|
11
|
+
User,
|
|
12
|
+
UserContextMenuCommandInteraction,
|
|
13
|
+
ClientEvents,
|
|
14
|
+
} from 'discord.js';
|
|
3
15
|
import InteractionUtil from '../utils/InteractionUtil.js';
|
|
4
16
|
import MessageUtil from '../utils/MessageUtil.js';
|
|
5
17
|
import { ModuleOptions, XernerxCache, XernerxCommands } from '../types/interfaces.js';
|
|
@@ -10,67 +22,63 @@ import ClientUtil from '../utils/ClientUtil.js';
|
|
|
10
22
|
import { XernerxContextCommand, XernerxMessageCommand, XernerxSlashCommand } from '../main.js';
|
|
11
23
|
import XernerxError from '../tools/XernerxError.js';
|
|
12
24
|
export interface XernerxUser extends User {
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
owner: boolean;
|
|
26
|
+
voted: boolean | null;
|
|
15
27
|
}
|
|
16
28
|
export interface XernerxMember extends GuildMember {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export interface XernerxGuild extends Guild {
|
|
20
|
-
}
|
|
21
|
-
export interface XernerxGuildChannel extends GuildChannel {
|
|
22
|
-
}
|
|
23
|
-
export interface XernerxDMChannel extends DMChannel {
|
|
24
|
-
}
|
|
25
|
-
interface XernerxCommand {
|
|
29
|
+
username: string;
|
|
26
30
|
}
|
|
31
|
+
export interface XernerxGuild extends Guild {}
|
|
32
|
+
export interface XernerxGuildChannel extends GuildChannel {}
|
|
33
|
+
export interface XernerxDMChannel extends DMChannel {}
|
|
34
|
+
interface XernerxCommand {}
|
|
27
35
|
export interface XernerxMessage extends Message, XernerxCommand {
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
user: XernerxUser;
|
|
37
|
+
util: MessageUtil;
|
|
30
38
|
}
|
|
31
39
|
export interface XernerxSlashInteraction extends ChatInputCommandInteraction, XernerxCommand {
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
user: XernerxUser;
|
|
41
|
+
util: InteractionUtil;
|
|
34
42
|
}
|
|
35
43
|
export interface XernerxUserContextInteraction extends UserContextMenuCommandInteraction, XernerxCommand {
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
user: XernerxUser;
|
|
45
|
+
util: InteractionUtil;
|
|
38
46
|
}
|
|
39
47
|
export interface XernerxMessageContextInteraction extends MessageContextMenuCommandInteraction, XernerxCommand {
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
user: XernerxUser;
|
|
49
|
+
util: InteractionUtil;
|
|
42
50
|
}
|
|
43
51
|
export interface XernerxClientType extends XernerxClient {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
commands: XernerxCommands;
|
|
53
|
+
events: Collection<string, XernerxEvent<keyof XernerxClientEvents>>;
|
|
54
|
+
inhibitors: Collection<string, XernerxInhibitor>;
|
|
55
|
+
modules: ModuleOptions;
|
|
56
|
+
util: ClientUtil;
|
|
57
|
+
stats: {
|
|
58
|
+
guildCount: number;
|
|
59
|
+
userCount: number;
|
|
60
|
+
shardId: number;
|
|
61
|
+
shardCount: number;
|
|
62
|
+
};
|
|
63
|
+
cooldown: {
|
|
64
|
+
default: number;
|
|
65
|
+
cache: number;
|
|
66
|
+
collections: Array<string>;
|
|
67
|
+
};
|
|
68
|
+
cache: XernerxCache;
|
|
69
|
+
connect: () => Promise<string>;
|
|
62
70
|
}
|
|
63
71
|
interface CommandBlockInfo {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
reason: string;
|
|
73
|
+
message: string;
|
|
74
|
+
required: Array<string> | string;
|
|
75
|
+
missing: Array<string> | string;
|
|
68
76
|
}
|
|
69
77
|
export interface XernerxClientEvents extends ClientEvents {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
commandBlock: [event: XernerxMessage | XernerxSlashInteraction, info: CommandBlockInfo, command: XernerxSlashCommand | XernerxMessageCommand | XernerxContextCommand];
|
|
79
|
+
commandError: [event: XernerxMessage | XernerxSlashInteraction, error: XernerxError, command: XernerxSlashCommand | XernerxMessageCommand | XernerxContextCommand];
|
|
80
|
+
commandStart: [event: XernerxMessage | XernerxSlashInteraction, command: XernerxSlashCommand | XernerxMessageCommand | XernerxContextCommand];
|
|
81
|
+
commandFinish: [event: XernerxMessage | XernerxSlashInteraction, command: XernerxSlashCommand | XernerxMessageCommand | XernerxContextCommand];
|
|
82
|
+
commandNotFound: [event: XernerxMessage | XernerxSlashInteraction, commandName: string, filetype: 'MessageCommand' | 'SlashCommand' | 'ContextCommand'];
|
|
75
83
|
}
|
|
76
84
|
export {};
|