Fixed pagination jump limit, fixed debug logging
This commit is contained in:
parent
5b2f355c9c
commit
3ffb7f4949
3 changed files with 6 additions and 8 deletions
4
app.js
4
app.js
|
@ -129,7 +129,7 @@ if (isMaster) {
|
||||||
new winston.transports.File({ filename: "logs/error.log", level: "error" }),
|
new winston.transports.File({ filename: "logs/error.log", level: "error" }),
|
||||||
new winston.transports.File({ filename: "logs/main.log" })
|
new winston.transports.File({ filename: "logs/main.log" })
|
||||||
],
|
],
|
||||||
level: "main",
|
level: process.env.DEBUG_LOG ? "debug" : "main",
|
||||||
format: winston.format.combine(
|
format: winston.format.combine(
|
||||||
winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
|
winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
|
||||||
winston.format.printf((info) => {
|
winston.format.printf((info) => {
|
||||||
|
@ -145,7 +145,7 @@ if (isMaster) {
|
||||||
winston.addColors({
|
winston.addColors({
|
||||||
info: "green",
|
info: "green",
|
||||||
main: "gray",
|
main: "gray",
|
||||||
debug: "purple",
|
debug: "magenta",
|
||||||
warn: "yellow",
|
warn: "yellow",
|
||||||
error: "red"
|
error: "red"
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,6 @@ import InteractionCollector from "./awaitinteractions.js";
|
||||||
import { ComponentInteraction } from "eris";
|
import { ComponentInteraction } from "eris";
|
||||||
|
|
||||||
export default async (client, message, pages, timeout = 120000) => {
|
export default async (client, message, pages, timeout = 120000) => {
|
||||||
const manageMessages = message.channel.guild && message.channel.permissionsOf(client.user.id).has("manageMessages") ? true : false;
|
|
||||||
const options = {
|
const options = {
|
||||||
messageReference: {
|
messageReference: {
|
||||||
channelID: message.channel.id,
|
channelID: message.channel.id,
|
||||||
|
@ -82,13 +81,13 @@ export default async (client, message, pages, timeout = 120000) => {
|
||||||
break;
|
break;
|
||||||
case "jump":
|
case "jump":
|
||||||
await interaction.deferUpdate();
|
await interaction.deferUpdate();
|
||||||
const newComponents = JSON.parse(JSON.stringify(components));
|
var newComponents = JSON.parse(JSON.stringify(components));
|
||||||
for (const index of newComponents.components[0].components.keys()) {
|
for (const index of newComponents.components[0].components.keys()) {
|
||||||
newComponents.components[0].components[index].disabled = true;
|
newComponents.components[0].components[index].disabled = true;
|
||||||
}
|
}
|
||||||
currentPage = await currentPage.edit(newComponents);
|
currentPage = await currentPage.edit(newComponents);
|
||||||
interactionCollector.extend();
|
interactionCollector.extend();
|
||||||
const jumpComponents = {
|
var jumpComponents = {
|
||||||
components: [{
|
components: [{
|
||||||
type: 1,
|
type: 1,
|
||||||
components: [{
|
components: [{
|
||||||
|
@ -99,7 +98,7 @@ export default async (client, message, pages, timeout = 120000) => {
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
for (let i = 0; i < pages.length; i++) {
|
for (let i = 0; i < pages.length && i < 25; i++) {
|
||||||
const payload = {
|
const payload = {
|
||||||
label: i + 1,
|
label: i + 1,
|
||||||
value: i
|
value: i
|
||||||
|
|
|
@ -130,8 +130,7 @@ class ImageWorker extends BaseServiceWorker {
|
||||||
if (i < 2 && e === "Request ended prematurely due to a closed connection") {
|
if (i < 2 && e === "Request ended prematurely due to a closed connection") {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
if (e === "No available servers" && i >= 2) e = "Request ended prematurely due to a closed connection";
|
if (e === "No available servers" && i >= 2) throw "Request ended prematurely due to a closed connection";
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue