Fixed issue with pagination message
This commit is contained in:
parent
5e8c587c41
commit
382480e1c7
10
app.js
10
app.js
|
@ -39,7 +39,7 @@ k <BBBw BBBBEBBBBBBBBBBBBBBBBBQ4BM #
|
|||
|
||||
esmBot ${require("./package.json").version}, powered by eris-fleet ${require("./node_modules/eris-fleet/package.json").version}
|
||||
`);
|
||||
// a bit of a hacky way to get the eris-fleet version
|
||||
// a bit of a hacky way to get the eris-fleet version
|
||||
}
|
||||
|
||||
const Admiral = new Fleet({
|
||||
|
@ -100,13 +100,13 @@ const Admiral = new Fleet({
|
|||
},
|
||||
services: [
|
||||
{ name: "prometheus", path: path.join(__dirname, "./utils/services/prometheus.js") },
|
||||
{ name: "image", path: path.join(__dirname, "./utils/services/image.js")}
|
||||
{ name: "image", path: path.join(__dirname, "./utils/services/image.js") }
|
||||
]
|
||||
});
|
||||
|
||||
if (isMaster) {
|
||||
const logger = winston.createLogger({
|
||||
levels: {
|
||||
levels: {
|
||||
error: 0,
|
||||
warn: 1,
|
||||
info: 2,
|
||||
|
@ -125,12 +125,12 @@ if (isMaster) {
|
|||
const {
|
||||
timestamp, level, message, ...args
|
||||
} = info;
|
||||
|
||||
|
||||
return `[${timestamp}]: [${level.toUpperCase()}] - ${message} ${Object.keys(args).length ? JSON.stringify(args, null, 2) : ""}`;
|
||||
}),
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
winston.addColors({
|
||||
info: "green",
|
||||
main: "gray",
|
||||
|
|
2
shard.js
2
shard.js
|
@ -96,7 +96,7 @@ class Shard extends BaseClusterWorker {
|
|||
broadcast = false;
|
||||
return this.ipc.broadcast("broadcastEnd");
|
||||
});
|
||||
|
||||
|
||||
// connect to lavalink
|
||||
if (!sound.status && !sound.connected) sound.connect(this.bot);
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ exports.setup = async () => {
|
|||
}
|
||||
exists.push(command);
|
||||
}
|
||||
|
||||
|
||||
for (const { command } of counts.rows) {
|
||||
if (!exists.includes(command)) {
|
||||
await connection.query("DELETE FROM counts WHERE command = $1", [command]);
|
||||
|
|
|
@ -32,7 +32,7 @@ exports.setup = async () => {
|
|||
}
|
||||
exists.push(command);
|
||||
}
|
||||
|
||||
|
||||
for (const { command } of counts) {
|
||||
if (!exists.includes(command)) {
|
||||
connection.prepare("DELETE FROM counts WHERE command = ?").run(command);
|
||||
|
|
|
@ -10,7 +10,7 @@ class InteractionCollector extends EventEmitter {
|
|||
this.bot = client;
|
||||
this.listener = async (packet) => {
|
||||
if (packet.t !== "INTERACTION_CREATE") return;
|
||||
await this.verify(packet.d.message, packet.d.data.custom_id, packet.d.id, packet.d.token, packet.d.member ? packet.d.member.id : packet.d.user.id);
|
||||
await this.verify(packet.d.message, packet.d.data.custom_id, packet.d.id, packet.d.token, packet.d.member ? packet.d.member.user.id : packet.d.user.id);
|
||||
};
|
||||
this.bot.on("rawWS", this.listener);
|
||||
if (options.time) setTimeout(() => this.stop("time"), options.time);
|
||||
|
@ -18,8 +18,7 @@ class InteractionCollector extends EventEmitter {
|
|||
|
||||
async verify(message, interaction, id, token, member) {
|
||||
if (this.message.id !== message.id) return false;
|
||||
const msg = await this.bot.getMessage(message.channel_id, message.id);
|
||||
this.emit("interaction", msg, interaction, id, token, member);
|
||||
this.emit("interaction", interaction, id, token, member);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ module.exports = async (client, message, pages, timeout = 120000) => {
|
|||
let currentPage = await client.createMessage(message.channel.id, Object.assign(pages[page], options, pages.length > 1 ? components : {}));
|
||||
if (pages.length > 1) {
|
||||
const interactionCollector = new InteractionCollector(client, currentPage, { time: timeout });
|
||||
interactionCollector.on("interaction", async (msg, interaction, id, token, member) => {
|
||||
interactionCollector.on("interaction", async (interaction, id, token, member) => {
|
||||
if (member === message.author.id) {
|
||||
switch (interaction) {
|
||||
case "back":
|
||||
|
|
Loading…
Reference in New Issue