diff --git a/app.js b/app.js index e368ce6..32296a6 100644 --- a/app.js +++ b/app.js @@ -129,7 +129,7 @@ if (isMaster) { new winston.transports.File({ filename: "logs/error.log", level: "error" }), new winston.transports.File({ filename: "logs/main.log" }) ], - level: "main", + level: process.env.DEBUG_LOG ? "debug" : "main", format: winston.format.combine( winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), winston.format.printf((info) => { @@ -145,7 +145,7 @@ if (isMaster) { winston.addColors({ info: "green", main: "gray", - debug: "purple", + debug: "magenta", warn: "yellow", error: "red" }); diff --git a/utils/pagination/pagination.js b/utils/pagination/pagination.js index b129f49..190b72f 100644 --- a/utils/pagination/pagination.js +++ b/utils/pagination/pagination.js @@ -2,7 +2,6 @@ import InteractionCollector from "./awaitinteractions.js"; import { ComponentInteraction } from "eris"; 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 = { messageReference: { channelID: message.channel.id, @@ -82,13 +81,13 @@ export default async (client, message, pages, timeout = 120000) => { break; case "jump": 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()) { newComponents.components[0].components[index].disabled = true; } currentPage = await currentPage.edit(newComponents); interactionCollector.extend(); - const jumpComponents = { + var jumpComponents = { components: [{ type: 1, 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 = { label: i + 1, value: i diff --git a/utils/services/image.js b/utils/services/image.js index 6fa277b..67437a3 100644 --- a/utils/services/image.js +++ b/utils/services/image.js @@ -130,8 +130,7 @@ class ImageWorker extends BaseServiceWorker { if (i < 2 && e === "Request ended prematurely due to a closed connection") { continue; } else { - if (e === "No available servers" && i >= 2) e = "Request ended prematurely due to a closed connection"; - throw e; + if (e === "No available servers" && i >= 2) throw "Request ended prematurely due to a closed connection"; } } }