xernerx 3.4.3 → 3.5.1
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/README.md +10 -10
- package/dist/build/ContextCommandBuilder.d.ts +60 -42
- package/dist/build/ContextCommandBuilder.js +93 -86
- package/dist/build/EventBuilder.d.ts +21 -17
- package/dist/build/EventBuilder.js +34 -35
- package/dist/build/InhibitorBuilder.d.ts +19 -20
- package/dist/build/InhibitorBuilder.js +27 -27
- package/dist/build/MessageCommandBuilder.d.ts +53 -42
- package/dist/build/MessageCommandBuilder.js +90 -78
- package/dist/build/SlashCommandBuilder.d.ts +58 -40
- package/dist/build/SlashCommandBuilder.js +125 -118
- package/dist/client/XernerxClient.d.ts +28 -28
- package/dist/client/XernerxClient.js +101 -83
- package/dist/handlers/CommandHandler.d.ts +27 -27
- package/dist/handlers/CommandHandler.js +42 -42
- package/dist/handlers/EventHandler.d.ts +13 -13
- package/dist/handlers/EventHandler.js +16 -16
- package/dist/handlers/Handler.d.ts +57 -57
- package/dist/handlers/Handler.js +250 -250
- package/dist/handlers/InhibitorHandler.d.ts +18 -18
- package/dist/handlers/InhibitorHandler.js +21 -21
- package/dist/main.cjs +2023 -0
- package/dist/main.d.ts +30 -30
- package/dist/main.js +42 -42
- package/dist/models/CommandArguments.d.ts +17 -17
- package/dist/models/CommandArguments.js +121 -123
- package/dist/models/Events.d.ts +24 -24
- package/dist/models/Events.js +294 -304
- package/dist/models/Extensions.d.ts +7 -7
- package/dist/models/Extensions.js +23 -23
- package/dist/tools/XernerxError.d.ts +5 -5
- package/dist/tools/XernerxError.js +8 -8
- package/dist/tools/package.d.ts +49 -38
- package/dist/tools/package.js +48 -41
- package/dist/types/enums.d.ts +35 -35
- package/dist/types/enums.js +35 -35
- package/dist/types/interfaces.d.ts +25 -25
- package/dist/types/interfaces.js +1 -1
- package/dist/types/options.d.ts +241 -206
- package/dist/types/options.js +1 -1
- package/dist/types/types.d.ts +34 -32
- package/dist/types/types.js +1 -1
- package/dist/utils/ClientUtil.d.ts +25 -25
- package/dist/utils/ClientUtil.js +222 -218
- package/dist/utils/CommandUtil.d.ts +56 -56
- package/dist/utils/CommandUtil.js +248 -260
- package/dist/validators/CommandValidations.d.ts +7 -7
- package/dist/validators/CommandValidations.js +183 -185
- package/dist/validators/InhibitorValidations.d.ts +11 -11
- package/dist/validators/InhibitorValidations.js +42 -42
- package/dist/validators/Shapes.js +1 -0
- package/package.json +54 -39
- package/dist/build/XContextCommandBuilder.d.ts +0 -40
- package/dist/build/XContextCommandBuilder.js +0 -84
- package/dist/build/XEventBuilder.d.ts +0 -17
- package/dist/build/XEventBuilder.js +0 -35
- package/dist/build/XInhibitorBuilder.d.ts +0 -20
- package/dist/build/XInhibitorBuilder.js +0 -28
- package/dist/build/XMessageCommandBuilder.d.ts +0 -42
- package/dist/build/XMessageCommandBuilder.js +0 -80
- package/dist/build/XSlashCommandBuilder.d.ts +0 -36
- package/dist/build/XSlashCommandBuilder.js +0 -114
- package/dist/models/CommandValidations.d.ts +0 -4
- package/dist/models/CommandValidations.js +0 -183
- package/dist/models/InhibitorValidations.d.ts +0 -12
- package/dist/models/InhibitorValidations.js +0 -42
package/dist/utils/ClientUtil.js
CHANGED
|
@@ -1,218 +1,222 @@
|
|
|
1
|
-
import XernerxError from '../tools/XernerxError.js';
|
|
2
|
-
export class ClientUtil {
|
|
3
|
-
client;
|
|
4
|
-
constructor(client) {
|
|
5
|
-
this.client = client;
|
|
6
|
-
}
|
|
7
|
-
uptime(timestamp) {
|
|
8
|
-
if (!timestamp)
|
|
9
|
-
timestamp = this.client.uptime || 0;
|
|
10
|
-
let totalSeconds = timestamp / 1000;
|
|
11
|
-
let years = Math.floor(totalSeconds / 31536000);
|
|
12
|
-
totalSeconds %= 31536000;
|
|
13
|
-
let days = Math.floor(totalSeconds / 86400);
|
|
14
|
-
totalSeconds %= 86400;
|
|
15
|
-
let hours = Math.floor(totalSeconds / 3600);
|
|
16
|
-
totalSeconds %= 3600;
|
|
17
|
-
let minutes = Math.floor(totalSeconds / 60);
|
|
18
|
-
let seconds = Math.floor(totalSeconds % 60);
|
|
19
|
-
if (years >= 1)
|
|
20
|
-
return `${years}y ${days}d ${hours}h ${minutes}m`;
|
|
21
|
-
else if (days >= 1)
|
|
22
|
-
return `${days}d ${hours}h ${minutes}m`;
|
|
23
|
-
else if (hours >= 1)
|
|
24
|
-
return `${hours}h ${minutes}m`;
|
|
25
|
-
else if (minutes >= 1)
|
|
26
|
-
return `${minutes}m ${seconds}s`;
|
|
27
|
-
else
|
|
28
|
-
return `${seconds}s`;
|
|
29
|
-
}
|
|
30
|
-
getSubcommands(name) {
|
|
31
|
-
if (!name || typeof name !== 'string')
|
|
32
|
-
throw new XernerxError(`Expected name to be of type string, received ${typeof name} instead!`);
|
|
33
|
-
const commands = [];
|
|
34
|
-
this.getAllCommands()
|
|
35
|
-
.filter((c) => (c.data?.name?.toLowerCase() || c.name?.toLowerCase()) == name?.toLowerCase())
|
|
36
|
-
.map((c) => {
|
|
37
|
-
if (c?.data?.options?.length > 0) {
|
|
38
|
-
c?.data?.options?.map((option) => {
|
|
39
|
-
if (!option?.type) {
|
|
40
|
-
if (option?.options?.length > 0) {
|
|
41
|
-
option?.options?.map((opt) => {
|
|
42
|
-
if (!opt.type) {
|
|
43
|
-
commands.push({
|
|
44
|
-
name: c.data.name,
|
|
45
|
-
formattedName: `${c.data.name} ${option.name} ${opt.name}`,
|
|
46
|
-
description: opt.description,
|
|
47
|
-
category: c.category || null,
|
|
48
|
-
commandType: c.commandType,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
commands.push({
|
|
53
|
-
name: c.data.name,
|
|
54
|
-
formattedName: `${c.data.name} ${option.name}`,
|
|
55
|
-
description: option.description,
|
|
56
|
-
category: c.category || null,
|
|
57
|
-
commandType: c.commandType,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
commands.push({
|
|
64
|
-
name: c.data.name,
|
|
65
|
-
formattedName: `${c.data.name} ${option.name}`,
|
|
66
|
-
description: option.description,
|
|
67
|
-
category: c.category || null,
|
|
68
|
-
commandType: c.commandType,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
commands.push({
|
|
74
|
-
name: c.data.name,
|
|
75
|
-
formattedName: `${c.data.name}`,
|
|
76
|
-
description: c.data.description,
|
|
77
|
-
category: c.category || null,
|
|
78
|
-
commandType: c.commandType,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
commands.push({
|
|
85
|
-
name: c.data?.name || c.name,
|
|
86
|
-
formattedName: `${c.data?.name || c.name}`,
|
|
87
|
-
description: c.data?.description || c.description,
|
|
88
|
-
category: c.category || null,
|
|
89
|
-
commandType: c.commandType,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
return commands;
|
|
94
|
-
}
|
|
95
|
-
isOwner(userId) {
|
|
96
|
-
if (!userId)
|
|
97
|
-
throw new XernerxError('No ID specified');
|
|
98
|
-
let owners = this.client.settings.ownerId;
|
|
99
|
-
if (!owners)
|
|
100
|
-
return false;
|
|
101
|
-
if (typeof owners === 'string')
|
|
102
|
-
owners = [owners];
|
|
103
|
-
return owners.includes(userId);
|
|
104
|
-
}
|
|
105
|
-
getAllCommands() {
|
|
106
|
-
const cmds = [];
|
|
107
|
-
for (const commands of Object.values(this.client.commands)) {
|
|
108
|
-
commands.map((cmd) => cmds.push(cmd));
|
|
109
|
-
}
|
|
110
|
-
return cmds;
|
|
111
|
-
}
|
|
112
|
-
getAllMessageCommands() {
|
|
113
|
-
const cmds = [];
|
|
114
|
-
this.client.commands.message.map((cmd) => cmds.push(cmd));
|
|
115
|
-
return cmds;
|
|
116
|
-
}
|
|
117
|
-
getAllSlashCommands() {
|
|
118
|
-
const cmds = [];
|
|
119
|
-
this.client.commands.slash.map((cmd) => cmds.push(cmd));
|
|
120
|
-
return cmds;
|
|
121
|
-
}
|
|
122
|
-
getAllContextCommands() {
|
|
123
|
-
const cmds = [];
|
|
124
|
-
this.client.commands.context.map((cmd) => cmds.push(cmd));
|
|
125
|
-
return cmds;
|
|
126
|
-
}
|
|
127
|
-
setPresence(options) {
|
|
128
|
-
const client = this.client;
|
|
129
|
-
function pres() {
|
|
130
|
-
client.user?.setPresence({
|
|
131
|
-
activities: [
|
|
132
|
-
{
|
|
133
|
-
name: options.text || undefined,
|
|
134
|
-
type: options.type || undefined,
|
|
135
|
-
url: options.link || undefined,
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
status: options.status || undefined,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
pres();
|
|
142
|
-
if (options.interval) {
|
|
143
|
-
setInterval(() => {
|
|
144
|
-
pres();
|
|
145
|
-
}, options.interval);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
getCooldowns(id, command) {
|
|
149
|
-
let cooldowns = [];
|
|
150
|
-
for (const [key, value] of Object.entries(this.client.cache)) {
|
|
151
|
-
if (!['cooldowns', 'messageCommands', 'slashCommands', 'contextCommands', 'commands'].includes(key))
|
|
152
|
-
continue;
|
|
153
|
-
if (key === 'commands') {
|
|
154
|
-
if (command) {
|
|
155
|
-
value.map((x) => {
|
|
156
|
-
const name = x.name.split(/-/);
|
|
157
|
-
name.pop();
|
|
158
|
-
if (name.join('-') === id + '-' + command) {
|
|
159
|
-
cooldowns.push(x);
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
value.map((x) => {
|
|
165
|
-
if (x.name.split(/-/).shift() === id) {
|
|
166
|
-
cooldowns.push(x);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
if (value.has(id)) {
|
|
173
|
-
const x = value.get(id);
|
|
174
|
-
cooldowns.push(x);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return cooldowns;
|
|
179
|
-
}
|
|
180
|
-
getCooldownTimers(id, command) {
|
|
181
|
-
let cooldowns = [];
|
|
182
|
-
for (const [key, value] of Object.entries(this.client.cache)) {
|
|
183
|
-
if (!['cooldowns', 'messageCommands', 'slashCommands', 'contextCommands', 'commands'].includes(key))
|
|
184
|
-
continue;
|
|
185
|
-
if (key === 'commands') {
|
|
186
|
-
if (command) {
|
|
187
|
-
value.map((x) => {
|
|
188
|
-
const name = x.name.split(/-/);
|
|
189
|
-
name.pop();
|
|
190
|
-
if (name.join('-') === id + '-' + command) {
|
|
191
|
-
cooldowns.push({
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
1
|
+
import XernerxError from '../tools/XernerxError.js';
|
|
2
|
+
export class ClientUtil {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
uptime(timestamp) {
|
|
8
|
+
if (!timestamp)
|
|
9
|
+
timestamp = this.client.uptime || 0;
|
|
10
|
+
let totalSeconds = timestamp / 1000;
|
|
11
|
+
let years = Math.floor(totalSeconds / 31536000);
|
|
12
|
+
totalSeconds %= 31536000;
|
|
13
|
+
let days = Math.floor(totalSeconds / 86400);
|
|
14
|
+
totalSeconds %= 86400;
|
|
15
|
+
let hours = Math.floor(totalSeconds / 3600);
|
|
16
|
+
totalSeconds %= 3600;
|
|
17
|
+
let minutes = Math.floor(totalSeconds / 60);
|
|
18
|
+
let seconds = Math.floor(totalSeconds % 60);
|
|
19
|
+
if (years >= 1)
|
|
20
|
+
return `${years}y ${days}d ${hours}h ${minutes}m`;
|
|
21
|
+
else if (days >= 1)
|
|
22
|
+
return `${days}d ${hours}h ${minutes}m`;
|
|
23
|
+
else if (hours >= 1)
|
|
24
|
+
return `${hours}h ${minutes}m`;
|
|
25
|
+
else if (minutes >= 1)
|
|
26
|
+
return `${minutes}m ${seconds}s`;
|
|
27
|
+
else
|
|
28
|
+
return `${seconds}s`;
|
|
29
|
+
}
|
|
30
|
+
getSubcommands(name) {
|
|
31
|
+
if (!name || typeof name !== 'string')
|
|
32
|
+
throw new XernerxError(`Expected name to be of type string, received ${typeof name} instead!`);
|
|
33
|
+
const commands = [];
|
|
34
|
+
this.getAllCommands()
|
|
35
|
+
.filter((c) => (c.data?.name?.toLowerCase() || c.name?.toLowerCase()) == name?.toLowerCase())
|
|
36
|
+
.map((c) => {
|
|
37
|
+
if (c?.data?.options?.length > 0) {
|
|
38
|
+
c?.data?.options?.map((option) => {
|
|
39
|
+
if (!option?.type) {
|
|
40
|
+
if (option?.options?.length > 0) {
|
|
41
|
+
option?.options?.map((opt) => {
|
|
42
|
+
if (!opt.type) {
|
|
43
|
+
commands.push({
|
|
44
|
+
name: c.data.name,
|
|
45
|
+
formattedName: `${c.data.name} ${option.name} ${opt.name}`,
|
|
46
|
+
description: opt.description,
|
|
47
|
+
category: c.category || null,
|
|
48
|
+
commandType: c.commandType,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
commands.push({
|
|
53
|
+
name: c.data.name,
|
|
54
|
+
formattedName: `${c.data.name} ${option.name}`,
|
|
55
|
+
description: option.description,
|
|
56
|
+
category: c.category || null,
|
|
57
|
+
commandType: c.commandType,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
commands.push({
|
|
64
|
+
name: c.data.name,
|
|
65
|
+
formattedName: `${c.data.name} ${option.name}`,
|
|
66
|
+
description: option.description,
|
|
67
|
+
category: c.category || null,
|
|
68
|
+
commandType: c.commandType,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
commands.push({
|
|
74
|
+
name: c.data.name,
|
|
75
|
+
formattedName: `${c.data.name}`,
|
|
76
|
+
description: c.data.description,
|
|
77
|
+
category: c.category || null,
|
|
78
|
+
commandType: c.commandType,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
commands.push({
|
|
85
|
+
name: c.data?.name || c.name,
|
|
86
|
+
formattedName: `${c.data?.name || c.name}`,
|
|
87
|
+
description: c.data?.description || c.description,
|
|
88
|
+
category: c.category || null,
|
|
89
|
+
commandType: c.commandType,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return commands;
|
|
94
|
+
}
|
|
95
|
+
isOwner(userId) {
|
|
96
|
+
if (!userId)
|
|
97
|
+
throw new XernerxError('No ID specified');
|
|
98
|
+
let owners = this.client.settings.ownerId;
|
|
99
|
+
if (!owners)
|
|
100
|
+
return false;
|
|
101
|
+
if (typeof owners === 'string')
|
|
102
|
+
owners = [owners];
|
|
103
|
+
return owners.includes(userId);
|
|
104
|
+
}
|
|
105
|
+
getAllCommands() {
|
|
106
|
+
const cmds = [];
|
|
107
|
+
for (const commands of Object.values(this.client.commands)) {
|
|
108
|
+
commands.map((cmd) => cmds.push(cmd));
|
|
109
|
+
}
|
|
110
|
+
return cmds;
|
|
111
|
+
}
|
|
112
|
+
getAllMessageCommands() {
|
|
113
|
+
const cmds = [];
|
|
114
|
+
this.client.commands.message.map((cmd) => cmds.push(cmd));
|
|
115
|
+
return cmds;
|
|
116
|
+
}
|
|
117
|
+
getAllSlashCommands() {
|
|
118
|
+
const cmds = [];
|
|
119
|
+
this.client.commands.slash.map((cmd) => cmds.push(cmd));
|
|
120
|
+
return cmds;
|
|
121
|
+
}
|
|
122
|
+
getAllContextCommands() {
|
|
123
|
+
const cmds = [];
|
|
124
|
+
this.client.commands.context.map((cmd) => cmds.push(cmd));
|
|
125
|
+
return cmds;
|
|
126
|
+
}
|
|
127
|
+
setPresence(options) {
|
|
128
|
+
const client = this.client;
|
|
129
|
+
function pres() {
|
|
130
|
+
client.user?.setPresence({
|
|
131
|
+
activities: [
|
|
132
|
+
{
|
|
133
|
+
name: options.text || undefined,
|
|
134
|
+
type: options.type || undefined,
|
|
135
|
+
url: options.link || undefined,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
status: options.status || undefined,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
pres();
|
|
142
|
+
if (options.interval) {
|
|
143
|
+
setInterval(() => {
|
|
144
|
+
pres();
|
|
145
|
+
}, options.interval);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
getCooldowns(id, command) {
|
|
149
|
+
let cooldowns = [];
|
|
150
|
+
for (const [key, value] of Object.entries(this.client.cache)) {
|
|
151
|
+
if (!['cooldowns', 'messageCommands', 'slashCommands', 'contextCommands', 'commands'].includes(key))
|
|
152
|
+
continue;
|
|
153
|
+
if (key === 'commands') {
|
|
154
|
+
if (command) {
|
|
155
|
+
value.map((x) => {
|
|
156
|
+
const name = x.name.split(/-/);
|
|
157
|
+
name.pop();
|
|
158
|
+
if (name.join('-') === id + '-' + command) {
|
|
159
|
+
cooldowns.push(x);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
value.map((x) => {
|
|
165
|
+
if (x.name.split(/-/).shift() === id) {
|
|
166
|
+
cooldowns.push(x);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
if (value.has(id)) {
|
|
173
|
+
const x = value.get(id);
|
|
174
|
+
cooldowns.push(x);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return cooldowns;
|
|
179
|
+
}
|
|
180
|
+
getCooldownTimers(id, command) {
|
|
181
|
+
let cooldowns = [];
|
|
182
|
+
for (const [key, value] of Object.entries(this.client.cache)) {
|
|
183
|
+
if (!['cooldowns', 'messageCommands', 'slashCommands', 'contextCommands', 'commands'].includes(key))
|
|
184
|
+
continue;
|
|
185
|
+
if (key === 'commands') {
|
|
186
|
+
if (command) {
|
|
187
|
+
value.map((x) => {
|
|
188
|
+
const name = x.name.split(/-/);
|
|
189
|
+
name.pop();
|
|
190
|
+
if (name.join('-') === id + '-' + command) {
|
|
191
|
+
cooldowns.push({
|
|
192
|
+
[x.commandName]: x.endsAt - Date.now(),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
value.map((x) => {
|
|
199
|
+
if (x.name.split(/-/).shift() === id) {
|
|
200
|
+
cooldowns.push({
|
|
201
|
+
[x.commandName]: x.endsAt - Date.now(),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
if (value.has(id)) {
|
|
209
|
+
const x = value.get(id);
|
|
210
|
+
cooldowns.push({ [key]: x.endsAt - Date.now() });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const sort = cooldowns.map((x) => Object.entries(x).shift()).sort((a, b) => b[1] - a[1]);
|
|
215
|
+
cooldowns = [];
|
|
216
|
+
sort.map(([key, value]) => cooldowns.push({ [key]: value }));
|
|
217
|
+
return cooldowns;
|
|
218
|
+
}
|
|
219
|
+
async defer(time) {
|
|
220
|
+
return new Promise((resolve) => setTimeout(resolve, time || 0));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { ActionRowBuilder, ButtonBuilder, EmbedBuilder, Interaction, Message, MessagePayload, StringSelectMenuBuilder } from 'discord.js';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
import { XernerxMessage } from '../types/types.js';
|
|
4
|
-
interface SelectMenuOptions {
|
|
5
|
-
index?: EmbedBuilder;
|
|
6
|
-
row?: ActionRowBuilder;
|
|
7
|
-
component?: StringSelectMenuBuilder;
|
|
8
|
-
components?: object[];
|
|
9
|
-
reply?: boolean;
|
|
10
|
-
id?: string;
|
|
11
|
-
filter?: Function;
|
|
12
|
-
time?: number;
|
|
13
|
-
ephemeral?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface ButtonOptions {
|
|
16
|
-
index?: number;
|
|
17
|
-
buttons?: Array<string>;
|
|
18
|
-
reply?: boolean;
|
|
19
|
-
row?: ActionRowBuilder;
|
|
20
|
-
component?: ButtonBuilder;
|
|
21
|
-
components?: object[];
|
|
22
|
-
id?: string;
|
|
23
|
-
filter?: any;
|
|
24
|
-
time?: number;
|
|
25
|
-
ephemeral?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare class MessageCommandUtil {
|
|
28
|
-
client: XernerxClient;
|
|
29
|
-
message: XernerxMessage;
|
|
30
|
-
constructor(client: XernerxClient, message: Message & XernerxMessage);
|
|
31
|
-
reply(content: MessagePayload | string): Promise<Message<boolean> | undefined>;
|
|
32
|
-
send(content: MessagePayload | string): Promise<Message<true> | Message<false> | undefined>;
|
|
33
|
-
defer(time: number): Promise<unknown>;
|
|
34
|
-
getCommands(): import("@discordjs/collection").Collection<string, import("../main.js").MessageCommandBuilder>;
|
|
35
|
-
getCommandName(): void;
|
|
36
|
-
selectMenuPaginator(embeds: Array<EmbedBuilder>, options?: SelectMenuOptions): void;
|
|
37
|
-
buttonPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions): void;
|
|
38
|
-
buttonMenuPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions & SelectMenuOptions): void;
|
|
39
|
-
isOwner(): boolean;
|
|
40
|
-
createModal(): void;
|
|
41
|
-
}
|
|
42
|
-
export declare class InteractionCommandUtil {
|
|
43
|
-
client: XernerxClient;
|
|
44
|
-
interaction: any;
|
|
45
|
-
constructor(client: XernerxClient, interaction: Interaction);
|
|
46
|
-
reply(content: MessagePayload | string): any;
|
|
47
|
-
defer(time: number): Promise<unknown>;
|
|
48
|
-
getCommands(): import("@discordjs/collection").Collection<string, import("../main.js").SlashCommandBuilder> | import("@discordjs/collection").Collection<string, import("../main.js").ContextCommandBuilder>;
|
|
49
|
-
getCommandName(): void;
|
|
50
|
-
selectMenuPaginator(embeds: Array<EmbedBuilder>, options?: SelectMenuOptions): void;
|
|
51
|
-
buttonPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions): void;
|
|
52
|
-
buttonMenuPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions & SelectMenuOptions): void;
|
|
53
|
-
isOwner(): boolean;
|
|
54
|
-
createModal(): void;
|
|
55
|
-
}
|
|
56
|
-
export {};
|
|
1
|
+
import { ActionRowBuilder, ButtonBuilder, EmbedBuilder, Interaction, Message, MessagePayload, StringSelectMenuBuilder } from 'discord.js';
|
|
2
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
+
import { XernerxMessage } from '../types/types.js';
|
|
4
|
+
interface SelectMenuOptions {
|
|
5
|
+
index?: EmbedBuilder;
|
|
6
|
+
row?: ActionRowBuilder;
|
|
7
|
+
component?: StringSelectMenuBuilder;
|
|
8
|
+
components?: object[];
|
|
9
|
+
reply?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
filter?: Function;
|
|
12
|
+
time?: number;
|
|
13
|
+
ephemeral?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface ButtonOptions {
|
|
16
|
+
index?: number;
|
|
17
|
+
buttons?: Array<string>;
|
|
18
|
+
reply?: boolean;
|
|
19
|
+
row?: ActionRowBuilder;
|
|
20
|
+
component?: ButtonBuilder;
|
|
21
|
+
components?: object[];
|
|
22
|
+
id?: string;
|
|
23
|
+
filter?: any;
|
|
24
|
+
time?: number;
|
|
25
|
+
ephemeral?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class MessageCommandUtil {
|
|
28
|
+
client: XernerxClient;
|
|
29
|
+
message: XernerxMessage;
|
|
30
|
+
constructor(client: XernerxClient, message: Message & XernerxMessage);
|
|
31
|
+
reply(content: MessagePayload | string): Promise<Message<boolean> | undefined>;
|
|
32
|
+
send(content: MessagePayload | string): Promise<Message<true> | Message<false> | undefined>;
|
|
33
|
+
defer(time: number): Promise<unknown>;
|
|
34
|
+
getCommands(): import("@discordjs/collection").Collection<string, import("../main.js").MessageCommandBuilder>;
|
|
35
|
+
getCommandName(): void;
|
|
36
|
+
selectMenuPaginator(embeds: Array<EmbedBuilder>, options?: SelectMenuOptions): void;
|
|
37
|
+
buttonPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions): void;
|
|
38
|
+
buttonMenuPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions & SelectMenuOptions): void;
|
|
39
|
+
isOwner(): boolean;
|
|
40
|
+
createModal(): void;
|
|
41
|
+
}
|
|
42
|
+
export declare class InteractionCommandUtil {
|
|
43
|
+
client: XernerxClient;
|
|
44
|
+
interaction: any;
|
|
45
|
+
constructor(client: XernerxClient, interaction: Interaction);
|
|
46
|
+
reply(content: MessagePayload | string): any;
|
|
47
|
+
defer(time: number): Promise<unknown>;
|
|
48
|
+
getCommands(): import("@discordjs/collection").Collection<string, import("../main.js").SlashCommandBuilder> | import("@discordjs/collection").Collection<string, import("../main.js").ContextCommandBuilder>;
|
|
49
|
+
getCommandName(): void;
|
|
50
|
+
selectMenuPaginator(embeds: Array<EmbedBuilder>, options?: SelectMenuOptions): void;
|
|
51
|
+
buttonPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions): void;
|
|
52
|
+
buttonMenuPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions & SelectMenuOptions): void;
|
|
53
|
+
isOwner(): boolean;
|
|
54
|
+
createModal(): void;
|
|
55
|
+
}
|
|
56
|
+
export {};
|