xernerx 2.7.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +0 -0
- package/dist/build/ContextCommand.d.ts +39 -0
- package/dist/build/ContextCommand.js +86 -0
- package/dist/build/Event.d.ts +15 -0
- package/dist/build/Event.js +31 -0
- package/dist/build/Inhibitor.d.ts +12 -0
- package/dist/build/Inhibitor.js +20 -0
- package/dist/build/MessageCommand.d.ts +39 -0
- package/dist/build/MessageCommand.js +77 -0
- package/dist/build/SlashCommand.d.ts +32 -0
- package/dist/build/SlashCommand.js +119 -0
- package/dist/client/XernerxClient.d.ts +22 -0
- package/dist/client/XernerxClient.js +76 -0
- package/dist/handlers/CommandHandler.d.ts +27 -0
- package/dist/handlers/CommandHandler.js +42 -0
- package/dist/handlers/EventHandler.d.ts +13 -0
- package/dist/handlers/EventHandler.js +16 -0
- package/dist/handlers/Handler.d.ts +37 -0
- package/dist/handlers/Handler.js +242 -0
- package/dist/handlers/InhibitorHandler.d.ts +18 -0
- package/dist/handlers/InhibitorHandler.js +21 -0
- package/dist/interfaces/ClientInterfaces.d.ts +58 -0
- package/dist/interfaces/ClientInterfaces.js +1 -0
- package/dist/interfaces/CommandInterfaces.d.ts +94 -0
- package/dist/interfaces/CommandInterfaces.js +1 -0
- package/dist/interfaces/HandlerInterfaces.d.ts +70 -0
- package/dist/interfaces/HandlerInterfaces.js +1 -0
- package/dist/main.d.ts +26 -0
- package/dist/main.js +40 -0
- package/dist/models/CommandArguments.d.ts +9 -0
- package/dist/models/CommandArguments.js +128 -0
- package/dist/models/CommandValidations.d.ts +3 -0
- package/dist/models/CommandValidations.js +193 -0
- package/dist/models/Events.d.ts +23 -0
- package/dist/models/Events.js +328 -0
- package/dist/models/Functions.d.ts +1 -0
- package/dist/models/Functions.js +30 -0
- package/dist/models/InhibitorValidations.d.ts +17 -0
- package/dist/models/InhibitorValidations.js +42 -0
- package/dist/types/EventTypes.d.ts +1 -0
- package/dist/types/EventTypes.js +1 -0
- package/dist/types/InhibitorTypes.d.ts +12 -0
- package/dist/types/InhibitorTypes.js +13 -0
- package/dist/types/Types.d.ts +24 -0
- package/dist/types/Types.js +21 -0
- package/dist/utils/ClientUtil.d.ts +25 -0
- package/dist/utils/ClientUtil.js +232 -0
- package/dist/utils/CommandUtil.d.ts +24 -0
- package/dist/utils/CommandUtil.js +163 -0
- package/package.json +5 -8
- package/main.js +0 -49
- package/models/Client.js +0 -60
- package/models/commands/ContextMenuCommand.js +0 -68
- package/models/commands/Event.js +0 -33
- package/models/commands/Inhibitor.js +0 -31
- package/models/commands/InteractionCommand.js +0 -142
- package/models/commands/MessageCommand.js +0 -86
- package/models/data/colors.json +0 -16
- package/models/data/options.json +0 -27
- package/models/events/interactionCreate.js +0 -84
- package/models/events/messageCreate.js +0 -84
- package/models/events/messageUpdate.js +0 -83
- package/models/events/readyOnce.js +0 -58
- package/models/handlers/CommandHandler.js +0 -37
- package/models/handlers/EventHandler.js +0 -67
- package/models/handlers/Handler.js +0 -111
- package/models/handlers/InhibitorHandler.js +0 -16
- package/models/handlers/LanguageHandler.js +0 -37
- package/models/utils/Arguments.js +0 -120
- package/models/utils/CommandValidation.js +0 -96
- package/models/utils/CommandsUtil.js +0 -70
- package/models/utils/Functions.js +0 -266
- package/models/utils/InhibitorsUtil.js +0 -24
- package/models/utils/InhibitorsValidation.js +0 -40
- package/models/utils/Util.js +0 -96
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
const colors = require('../data/colors.json');
|
|
2
|
-
const { EmbedBuilder, ActionRowBuilder, SelectMenuBuilder, Embed, ButtonBuilder, ButtonStyle } = require('discord.js');
|
|
3
|
-
const opts = require('../data/options.json');
|
|
4
|
-
const { logStyle } = require('dumfunctions');
|
|
5
|
-
|
|
6
|
-
function reply(interaction, text) {
|
|
7
|
-
return (interaction.replied || interaction.deferred) ? interaction.editReply(text) : interaction.reply(text);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @param {object} Functions - Build in functions of the bot hidden away in the handlers/setters.
|
|
12
|
-
*/
|
|
13
|
-
module.exports = new class Functions {
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @param {object} client - Client object.
|
|
17
|
-
* @param {object} options - Client options.
|
|
18
|
-
* @returns an object of default colors and custom colors to be imported anywhere without having to import them.
|
|
19
|
-
*/
|
|
20
|
-
color({ client: client, options: options }) {
|
|
21
|
-
client.color = { FLAGS: colors }
|
|
22
|
-
|
|
23
|
-
if (options.color) {
|
|
24
|
-
for (const [name, color] of Object.entries(options.color)) {
|
|
25
|
-
client.color[name] = color;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return client.color;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @param {object} client - Client object.
|
|
35
|
-
* @param {object} options - Client options.
|
|
36
|
-
* @returns custom config settings for the bot.
|
|
37
|
-
*/
|
|
38
|
-
config({ client: client, options: options }) {
|
|
39
|
-
client.config = {}
|
|
40
|
-
|
|
41
|
-
if (options.config) {
|
|
42
|
-
for (const [key, value] of Object.entries(options.config)) {
|
|
43
|
-
client.config[key] = value;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return client.config;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
reply(interaction, text) {
|
|
51
|
-
return (interaction.replied || interaction.deferred) ? interaction.editReply(text) : interaction.reply(text);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
selectMenuPaginator(interaction, embeds, options = {}) {
|
|
55
|
-
if (!embeds) return interaction.client.emit('error', interaction, "no embeds");
|
|
56
|
-
|
|
57
|
-
if (!Array.isArray(embeds)) return interaction.client.emit('error', interaction, "no array of embeds")
|
|
58
|
-
|
|
59
|
-
if (!options.index) {
|
|
60
|
-
options.index = new EmbedBuilder()
|
|
61
|
-
.setTitle(`${embeds.length} pages`)
|
|
62
|
-
|
|
63
|
-
embeds.map((embed, i = 0) => options.index.addFields([{ name: embed?.data?.title || embed?.data?.author?.name || "No name", value: embed?.data?.description || `Page ${i + 1}` }]))
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!options.row) {
|
|
67
|
-
options.row = new ActionRowBuilder();
|
|
68
|
-
|
|
69
|
-
if (!options.id) options.id = `${interaction.id}-menu`;
|
|
70
|
-
|
|
71
|
-
options.comp = new SelectMenuBuilder()
|
|
72
|
-
.setCustomId(options.id)
|
|
73
|
-
.setMaxValues(1)
|
|
74
|
-
.setMinValues(1)
|
|
75
|
-
.setPlaceholder('Select a page.')
|
|
76
|
-
.addOptions({ label: 'Index', description: 'Index Page', value: 'index' })
|
|
77
|
-
|
|
78
|
-
embeds.map((embed, i = 0) => options.comp.addOptions({ label: embed?.data?.title || embed?.data?.author?.name, description: embed?.data?.description?.slice(0, 100) || `Page ${i + 1}`, value: opts[embeds.indexOf(embed)] }))
|
|
79
|
-
|
|
80
|
-
options.row.addComponents(options.comp);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (!options.id) options.id = options.row.components[0].data.custom_id;
|
|
84
|
-
|
|
85
|
-
(async () => {
|
|
86
|
-
let embed = options.index;
|
|
87
|
-
|
|
88
|
-
let m = options.send ? await interaction.channel.send({ embeds: [embed], components: [options.row, ...options.components] }) : await reply(interaction, { embeds: [embed], components: [options.row, ...options.components] })
|
|
89
|
-
|
|
90
|
-
interaction.channel.createMessageComponentCollector({ filter: options.filter, time: options.time || 300000 })
|
|
91
|
-
|
|
92
|
-
.on('collect', async (a) => {
|
|
93
|
-
if (a.customId != options.id) return;
|
|
94
|
-
|
|
95
|
-
let chosen = a.values[0];
|
|
96
|
-
|
|
97
|
-
if (chosen === options.row.components[0]?.options[0]?.data?.value) embed = options.index;
|
|
98
|
-
|
|
99
|
-
else embed = embeds[opts.indexOf(chosen)];
|
|
100
|
-
|
|
101
|
-
a.update({ embeds: [embed] });
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
.on('end', async () => {
|
|
105
|
-
if (interaction.editReply) interaction.editReply({ components: [] });
|
|
106
|
-
|
|
107
|
-
if (interaction.edit) await m.edit({ components: [] });
|
|
108
|
-
})
|
|
109
|
-
})();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
commandName(interaction, cmd) {
|
|
113
|
-
if (cmd) {
|
|
114
|
-
let cmds = [];
|
|
115
|
-
|
|
116
|
-
for (const commands of Object.values(interaction.client.commands)) {
|
|
117
|
-
let commandInfo = {};
|
|
118
|
-
|
|
119
|
-
const command = commands.find(command => command?.data?.name === cmd.toLowerCase() || command?.name === cmd.toLowerCase() || command?.id == cmd.toLowerCase());
|
|
120
|
-
|
|
121
|
-
if (command) {
|
|
122
|
-
if (command?.data?.options?.length > 0) {
|
|
123
|
-
command?.data?.options?.map(option => {
|
|
124
|
-
if (!option?.type) {
|
|
125
|
-
if (option?.options?.length > 0) {
|
|
126
|
-
option?.options?.map(opt => {
|
|
127
|
-
if (!opt.type) {
|
|
128
|
-
commandInfo = {
|
|
129
|
-
name: command?.data?.name + " " + option?.name + " " + opt?.name,
|
|
130
|
-
description: opt.description,
|
|
131
|
-
category: command.category
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (!cmds.find(c => c.name === commandInfo.name)) cmds.push(commandInfo);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
else {
|
|
138
|
-
commandInfo = {
|
|
139
|
-
name: command?.data?.name + " " + option?.name,
|
|
140
|
-
description: option?.description,
|
|
141
|
-
category: command.category
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (!cmds.find(c => c.name === commandInfo.name)) cmds.push(commandInfo);
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
else {
|
|
150
|
-
commandInfo = {
|
|
151
|
-
name: command?.data?.name + " " + option?.name,
|
|
152
|
-
description: option?.description,
|
|
153
|
-
category: command.category
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (!cmds.find(c => c.name === commandInfo.name)) cmds.push(commandInfo);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
else {
|
|
161
|
-
commandInfo = {
|
|
162
|
-
name: command?.data?.name || command?.name || command?.id,
|
|
163
|
-
description: command?.data?.description || command?.description,
|
|
164
|
-
category: command.category
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (!cmds.find(c => c.name === commandInfo.name)) cmds.push(commandInfo);
|
|
168
|
-
}
|
|
169
|
-
})
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
else {
|
|
173
|
-
commandInfo = {
|
|
174
|
-
name: command?.data?.name || command?.name || command?.id,
|
|
175
|
-
description: command?.data?.description || command?.description,
|
|
176
|
-
category: command.category
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (!cmds.find(c => c.name === commandInfo.name)) cmds.push(commandInfo);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return cmds;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (!cmd) return [interaction?.commandName || interaction.name || interaction.content?.replace(interaction.client.settings.prefix.find(p => interaction.content.startsWith(p)), "").split(/ +/)[0], interaction?.options?._group, interaction?.options?._subcommand].join(' ').replace(/ +/g, " ").trim();
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
buttonPaginator(interaction, embeds, options = {}) {
|
|
190
|
-
if (!options.buttons) options.buttons = ["⏪", "◀️", "⏹️", "▶️", "⏩"];
|
|
191
|
-
|
|
192
|
-
if (options.buttons.length <= 4 || options.buttons.length > 5) throw new Error('Must specify 5 emotes.');
|
|
193
|
-
|
|
194
|
-
options.row = new ActionRowBuilder();
|
|
195
|
-
|
|
196
|
-
for (const button of options.buttons) {
|
|
197
|
-
options.row
|
|
198
|
-
.addComponents(
|
|
199
|
-
new ButtonBuilder()
|
|
200
|
-
.setCustomId(`${interaction.id}-${opts[options.buttons.indexOf(button)]}`)
|
|
201
|
-
.setStyle(ButtonStyle[options.style || 'Primary'])
|
|
202
|
-
.setEmoji(button)
|
|
203
|
-
)
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
(async () => {
|
|
207
|
-
let embed = embeds[options.index || 0];
|
|
208
|
-
|
|
209
|
-
let m = options.send ? await interaction.channel.send({ embeds: [embed], components: [options.row, ...options.components] }) : await reply(interaction, { embeds: [embed], components: [options.row, ...options.components] });
|
|
210
|
-
|
|
211
|
-
const collector = interaction.channel.createMessageComponentCollector({ filter: options.filter, time: options.time || 300000 })
|
|
212
|
-
|
|
213
|
-
.on('collect', async (a) => {
|
|
214
|
-
if (a.customId == `${interaction.id}-one`) {
|
|
215
|
-
embed = embeds[0];
|
|
216
|
-
a.update({ embeds: [embed] });
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (a.customId == `${interaction.id}-two`) {
|
|
220
|
-
embed = embeds[embeds.indexOf(embed) >= 1 ? embeds.indexOf(embed) - 1 : 0];
|
|
221
|
-
a.update({ embeds: [embed] });
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (a.customId == `${interaction.id}-three`) {
|
|
225
|
-
a.update({ components: [] });
|
|
226
|
-
collector.stop();
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if (a.customId == `${interaction.id}-four`) {
|
|
230
|
-
embed = embeds[embeds.indexOf(embed) < embeds.length - 1 ? embeds.indexOf(embed) + 1 : embeds.length - 1];
|
|
231
|
-
a.update({ embeds: [embed] });
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (a.customId == `${interaction.id}-five`) {
|
|
235
|
-
embed = embeds[embeds.length - 1];
|
|
236
|
-
a.update({ embeds: [embed] });
|
|
237
|
-
}
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
.on('end', async () => {
|
|
241
|
-
if (interaction.editReply) interaction.editReply({ components: [] });
|
|
242
|
-
|
|
243
|
-
if (interaction.edit) await m.edit({ components: [] });
|
|
244
|
-
})
|
|
245
|
-
})();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
uptime(interaction, timestamp) {
|
|
249
|
-
if (!timestamp) timestamp = interaction.client.uptime;
|
|
250
|
-
let totalSeconds = timestamp / 1000;
|
|
251
|
-
let years = Math.floor(totalSeconds / 31536000);
|
|
252
|
-
totalSeconds %= 31536000;
|
|
253
|
-
let days = Math.floor(totalSeconds / 86400);
|
|
254
|
-
totalSeconds %= 86400;
|
|
255
|
-
let hours = Math.floor(totalSeconds / 3600);
|
|
256
|
-
totalSeconds %= 3600;
|
|
257
|
-
let minutes = Math.floor(totalSeconds / 60);
|
|
258
|
-
let seconds = Math.floor(totalSeconds % 60);
|
|
259
|
-
|
|
260
|
-
if (years >= 1) return `${years}y ${days}d ${hours}h ${minutes}m`
|
|
261
|
-
else if (days >= 1) return `${days}d ${hours}h ${minutes}m`;
|
|
262
|
-
else if (hours >= 1) return `${hours}h ${minutes}m`;
|
|
263
|
-
else if (minutes >= 1) return `${minutes}m ${seconds}s`;
|
|
264
|
-
else return `${seconds}s`;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const { logStyle } = require('dumfunctions');
|
|
2
|
-
|
|
3
|
-
module.exports = new class InhibitorsUtil {
|
|
4
|
-
importInhibitors(client, path, files) {
|
|
5
|
-
for (const file of files) {
|
|
6
|
-
try {
|
|
7
|
-
let filepath = `${require("path").resolve(path)}/${file}`;
|
|
8
|
-
|
|
9
|
-
let inhibitor = require(filepath);
|
|
10
|
-
|
|
11
|
-
inhibitor = new inhibitor;
|
|
12
|
-
|
|
13
|
-
inhibitor.filepath = filepath;
|
|
14
|
-
|
|
15
|
-
inhibitor.client = client;
|
|
16
|
-
|
|
17
|
-
client.inhibitors.set(inhibitor.name, inhibitor);
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.error(logStyle(`Couldn't load ${file} because of <${error.message}>!`, "text", "red"));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module.exports = new class InhibitorValidation {
|
|
2
|
-
async inhibitorsValidation(event, command) {
|
|
3
|
-
let inhibited = {};
|
|
4
|
-
|
|
5
|
-
if (event.client.inhibitors.has(command.runType)) {
|
|
6
|
-
let inhibitor = event.client.inhibitors.get(command.runType);
|
|
7
|
-
|
|
8
|
-
inhibited[command.runType] = await inhibitor.check(event);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (event.client.inhibitors.has("member")) {
|
|
12
|
-
|
|
13
|
-
let inhibitor = event.client.inhibitors.get("member");
|
|
14
|
-
|
|
15
|
-
inhibited["member"] = await inhibitor.check(event, event.member);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (event.client.inhibitors.has("guild")) {
|
|
19
|
-
let inhibitor = event.client.inhibitors.get("guild");
|
|
20
|
-
|
|
21
|
-
inhibited["guild"] = await inhibitor.check(event, event.guild);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (event.client.inhibitors.has("user")) {
|
|
25
|
-
let inhibitor = event.client.inhibitors.get("user");
|
|
26
|
-
|
|
27
|
-
inhibited["user"] = await inhibitor.check(event, event.user || event.author);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (event.client.inhibitors.has("channel")) {
|
|
31
|
-
let inhibitor = event.client.inhibitors.get("channel");
|
|
32
|
-
|
|
33
|
-
inhibited["channel"] = await inhibitor.check(event);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
for (const inhibit of Object.values(inhibited)) {
|
|
37
|
-
if (inhibit) return inhibited;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
package/models/utils/Util.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
const { selectMenuPaginator, buttonPaginator, commandName, uptime, reply } = require('./Functions.js');
|
|
2
|
-
|
|
3
|
-
module.exports = new class Util {
|
|
4
|
-
async messageUtil(message, type) {
|
|
5
|
-
setTimeout(() => {
|
|
6
|
-
if (message.client.data.messages[message.id] === null || message.client.data.messages[message.id]) delete message.client.data.messages[message.id];
|
|
7
|
-
|
|
8
|
-
if (message.channel.messages.cache.has(message.id)) message.channel.messages.cache.delete(message.id);
|
|
9
|
-
}, message.client.settings.cacheTime);
|
|
10
|
-
|
|
11
|
-
message.util = {
|
|
12
|
-
selectMenuPaginator: (embeds, options) => selectMenuPaginator(message, embeds, options),
|
|
13
|
-
buttonPaginator: (embeds, options) => buttonPaginator(message, embeds, options),
|
|
14
|
-
commandName: (command) => commandName(message, command),
|
|
15
|
-
uptime: (timestamp) => uptime(message, timestamp)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (type == "create") {
|
|
19
|
-
message.client.data.messages[message.id] = null;
|
|
20
|
-
|
|
21
|
-
message.util.send = async (e) => {
|
|
22
|
-
const msg = await message.channel.send(e);
|
|
23
|
-
|
|
24
|
-
message.client.data.messages[message.id] = msg.id;
|
|
25
|
-
|
|
26
|
-
return msg;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
message.util.reply = async (e) => {
|
|
30
|
-
const msg = await message.reply(e);
|
|
31
|
-
|
|
32
|
-
message.client.data.messages[message.id] = msg.id;
|
|
33
|
-
|
|
34
|
-
return msg;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (type == 'edit') {
|
|
41
|
-
if (message.client.data.messages[message.id] === null) {
|
|
42
|
-
message.util.send = async (e) => {
|
|
43
|
-
const msg = await message.channel.send(e);
|
|
44
|
-
|
|
45
|
-
message.client.data.messages[message.id] = msg.id;
|
|
46
|
-
|
|
47
|
-
return msg;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
message.util.reply = async (e) => {
|
|
51
|
-
const msg = await message.reply(e);
|
|
52
|
-
|
|
53
|
-
message.client.data.messages[message.id] = msg.id;
|
|
54
|
-
|
|
55
|
-
return msg;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
else if (message.client.data.messages[message.id] !== null) {
|
|
62
|
-
const msg = await message.channel.messages.fetch(message.client.data.messages[message.id]);
|
|
63
|
-
|
|
64
|
-
message.util.send = async (e) => {
|
|
65
|
-
try {
|
|
66
|
-
return await msg.edit(e);
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
message.channel.send(e);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
message.util.reply = async (e) => {
|
|
74
|
-
try {
|
|
75
|
-
return await msg.edit(e);
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
message.reply(e);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interactionUtil(interaction) {
|
|
88
|
-
interaction.util = {
|
|
89
|
-
reply: (text) => reply(interaction, text),
|
|
90
|
-
selectMenuPaginator: (embeds, options) => selectMenuPaginator(interaction, embeds, options),
|
|
91
|
-
buttonPaginator: (embeds, options) => buttonPaginator(interaction, embeds, options),
|
|
92
|
-
commandName: (command) => commandName(interaction, command),
|
|
93
|
-
uptime: (timestamp) => uptime(interaction, timestamp)
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|