From 4773d9f16d895e24723bd6269cfc0ea9b62ed16d Mon Sep 17 00:00:00 2001 From: Evorp <3vorpgaming@gmail.com> Date: Sat, 4 Jan 2025 19:27:07 -0800 Subject: [PATCH] stricter code quality, update dependencies --- package.json | 4 +-- pnpm-lock.yaml | 28 +++++++++---------- src/commands/bot/feedback.ts | 4 +-- src/commands/bot/ping.ts | 4 +-- src/commands/bot/status.ts | 2 +- src/commands/developer/eval.ts | 4 +-- src/commands/developer/say.ts | 1 - src/commands/submission/autopush.ts | 4 +-- src/commands/submission/channelpush.ts | 4 +-- src/events/buttonUsed.ts | 2 +- src/events/messageCreate.ts | 2 +- src/functions/handleError.ts | 2 +- src/functions/images/magnify.ts | 2 +- src/functions/images/palette.ts | 2 +- src/functions/images/stitch.ts | 4 +-- src/functions/submission/handleResults.ts | 7 +++-- src/functions/submission/makeEmbed.ts | 2 +- src/functions/submission/reactionMenu.ts | 6 ++-- src/functions/submission/submitTexture.ts | 4 +-- .../submission/utility/choiceEmbed.ts | 15 ++++++---- .../submission/utility/generateComparison.ts | 6 ++-- .../submission/utility/getAuthors.ts | 2 +- .../submission/utility/getPackByChannel.ts | 4 +-- .../submission/utility/retrieveSubmission.ts | 8 +++--- 24 files changed, 63 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index f11b8119..a28ddde2 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "prettier": "prettier \"{,!(node_modules)/**/}*.ts\" --config .prettierrc --write" }, "devDependencies": { - "@types/node": "^22.10.2", + "@types/node": "^22.10.5", "nodemon": "^3.1.9", "prettier": "^3.4.2" }, @@ -17,7 +17,7 @@ "@napi-rs/canvas": "^0.1.65", "@octokit/rest": "^20.1.1", "axios": "^1.7.9", - "cron": "^3.3.1", + "cron": "^3.3.2", "discord.js": "^14.16.3", "dotenv": "^16.4.7", "gif-encoder-2": "^1.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 81b93923..1a984f06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: specifier: ^1.7.9 version: 1.7.9 cron: - specifier: ^3.3.1 - version: 3.3.1 + specifier: ^3.3.2 + version: 3.3.2 discord.js: specifier: ^14.16.3 version: 14.16.3 @@ -31,14 +31,14 @@ importers: version: 1.0.5 ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@22.10.2)(typescript@5.5.4) + version: 10.9.2(@types/node@22.10.5)(typescript@5.5.4) tsconfig-paths: specifier: ^4.2.0 version: 4.2.0 devDependencies: '@types/node': - specifier: ^22.10.2 - version: 22.10.2 + specifier: ^22.10.5 + version: 22.10.5 nodemon: specifier: ^3.1.9 version: 3.1.9 @@ -233,8 +233,8 @@ packages: '@types/luxon@3.4.2': resolution: {integrity: sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==} - '@types/node@22.10.2': - resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} + '@types/node@22.10.5': + resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==} '@types/ws@8.5.13': resolution: {integrity: sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==} @@ -296,8 +296,8 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - cron@3.3.1: - resolution: {integrity: sha512-KpvuzJEbeTMTfLsXhUuDfsFYr8s5roUlLKb4fa68GszWrA4783C7q6m9yj4vyc6neyD/V9e0YiADSX2c+yRDXg==} + cron@3.3.2: + resolution: {integrity: sha512-7o2PH9vKRd4PxB8c2GsHRozfHYT+gIhZG0DI+vzGOdWo42mofO/ooYnyU0CCh27aKzCrUKMAwAwi7xJ84xKSug==} debug@4.4.0: resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} @@ -736,13 +736,13 @@ snapshots: '@types/luxon@3.4.2': {} - '@types/node@22.10.2': + '@types/node@22.10.5': dependencies: undici-types: 6.20.0 '@types/ws@8.5.13': dependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.5 '@vladfrangu/async_event_emitter@2.4.6': {} @@ -804,7 +804,7 @@ snapshots: create-require@1.1.1: {} - cron@3.3.1: + cron@3.3.2: dependencies: '@types/luxon': 3.4.2 luxon: 3.5.0 @@ -963,14 +963,14 @@ snapshots: ts-mixer@6.0.4: {} - ts-node@10.9.2(@types/node@22.10.2)(typescript@5.5.4): + ts-node@10.9.2(@types/node@22.10.5)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.10.2 + '@types/node': 22.10.5 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 diff --git a/src/commands/bot/feedback.ts b/src/commands/bot/feedback.ts index 9136fa0c..fd8f75c3 100644 --- a/src/commands/bot/feedback.ts +++ b/src/commands/bot/feedback.ts @@ -71,12 +71,12 @@ export default { .setRequired(true), ), async execute(interaction) { - const type = interaction.options.getString("type"); + const type = interaction.options.getString("type") as keyof typeof feedbackFormat; const modal = new ModalBuilder().setCustomId(`${type}Ticket`).setTitle(`New ${type} issue`); modal.addComponents( // every modal input needs to be in a new action row (blame djs) - ...feedbackFormat[type].map((textInput: TextInputBuilder) => + ...feedbackFormat[type].map((textInput) => new ActionRowBuilder().addComponents(textInput), ), ); diff --git a/src/commands/bot/ping.ts b/src/commands/bot/ping.ts index 82f9d4ac..db343dc8 100644 --- a/src/commands/bot/ping.ts +++ b/src/commands/bot/ping.ts @@ -10,7 +10,7 @@ import type { Command } from "@interfaces/discord"; export default { data: new SlashCommandBuilder().setName("ping").setDescription(strings.command.description.ping), async execute(interaction) { - const quotes = ( + const quotes: string[] = ( await axios.get( `https://raw.githubusercontent.com/Faithful-Resource-Pack/CompliBot/main/json/quotes.json`, ) @@ -27,7 +27,7 @@ export default { const embed = new EmbedBuilder() .setTitle("Pong!") - .setDescription(`_${quote.replace("%YEAR%", new Date().getFullYear() + 2)}_`) + .setDescription(`_${quote.replace("%YEAR%", String(new Date().getFullYear() + 2))}_`) .setColor(settings.colors.blue) .addFields( { name: "Bot Latency", value: `${botPing}ms`, inline: true }, diff --git a/src/commands/bot/status.ts b/src/commands/bot/status.ts index d892b166..da495a66 100644 --- a/src/commands/bot/status.ts +++ b/src/commands/bot/status.ts @@ -23,7 +23,7 @@ export default { .setDescription("What activity the bot is doing (e.g. playing, streaming)") .addChoices( ...Object.values(ActivityType) - .filter((x) => typeof x == "string") + .filter((x) => typeof x === "string") .map((i) => ({ name: i, value: i })), ) .setRequired(true), diff --git a/src/commands/developer/eval.ts b/src/commands/developer/eval.ts index 7093b34e..3c51e256 100644 --- a/src/commands/developer/eval.ts +++ b/src/commands/developer/eval.ts @@ -20,7 +20,7 @@ export default { return warnUser(interaction, strings.command.no_permission); await interaction.deferReply({ ephemeral: true }); - const clean = async (text) => { + const clean = async (text: any) => { if (text && text.constructor.name === "Promise") text = await text; if (typeof text !== "string") text = require("util").inspect(text, { depth: 1 }); @@ -41,7 +41,7 @@ export default { // ---- const code = interaction.options.getString("code", true); - let evaluated; + let evaluated: any; try { evaluated = await eval( `(async () => { try { return await (async () => {${ diff --git a/src/commands/developer/say.ts b/src/commands/developer/say.ts index 3296e410..04205a0b 100644 --- a/src/commands/developer/say.ts +++ b/src/commands/developer/say.ts @@ -11,7 +11,6 @@ export default { .addStringOption((option) => option.setName("message").setDescription("What should the bot say?").setRequired(true), ) - .setDMPermission(false) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), async execute(interaction) { diff --git a/src/commands/submission/autopush.ts b/src/commands/submission/autopush.ts index e11b72a5..6664cee6 100644 --- a/src/commands/submission/autopush.ts +++ b/src/commands/submission/autopush.ts @@ -40,10 +40,10 @@ export default { const choice = interaction.options.getString("pack", true); const addContributions = interaction.options.getBoolean("contributions", false) ?? true; - if (choice == "all" && !process.env.DEVELOPERS.includes(interaction.user.id)) + if (choice === "all" && !process.env.DEVELOPERS.includes(interaction.user.id)) return warnUser(interaction, strings.command.no_permission); - const packs = choice == "all" ? Object.values(submissions) : [submissions[choice]]; + const packs = choice === "all" ? Object.values(submissions) : [submissions[choice]]; const infoEmbed = new EmbedBuilder() .setDescription("This can take some time, please wait...") diff --git a/src/commands/submission/channelpush.ts b/src/commands/submission/channelpush.ts index 40eba331..2fad0385 100644 --- a/src/commands/submission/channelpush.ts +++ b/src/commands/submission/channelpush.ts @@ -34,10 +34,10 @@ export default { const submissions: PackFile = require("@resources/packs.json"); const choice = interaction.options.getString("pack", true); const delay = interaction.options.getInteger("delay", false); - if (choice == "all" && !process.env.DEVELOPERS.includes(interaction.user.id)) + if (choice === "all" && !process.env.DEVELOPERS.includes(interaction.user.id)) return warnUser(interaction, strings.command.no_permission); - const packs = choice == "all" ? Object.values(submissions) : [submissions[choice]]; + const packs = choice === "all" ? Object.values(submissions) : [submissions[choice]]; await interaction.deferReply(); diff --git a/src/events/buttonUsed.ts b/src/events/buttonUsed.ts index 99839f9c..70655636 100644 --- a/src/events/buttonUsed.ts +++ b/src/events/buttonUsed.ts @@ -91,7 +91,7 @@ export default { message.deletable && (!original || hasPermission(interaction.member as GuildMember, "moderator") || - original.id == interaction.user.id) + original.id === interaction.user.id) ) return message.delete(); diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index dc2a638b..725b058e 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -17,7 +17,7 @@ export default { /** * TEXTURE SUBMISSION */ - if (Object.values(packs).some((pack) => pack.submission.channels.submit == message.channel.id)) + if (Object.values(packs).some((pack) => pack.submission.channels.submit === message.channel.id)) return submitTexture(message); /** diff --git a/src/functions/handleError.ts b/src/functions/handleError.ts index db80b6f9..fe03fa9b 100644 --- a/src/functions/handleError.ts +++ b/src/functions/handleError.ts @@ -23,7 +23,7 @@ export default function handleError(client: Client, error: any, type: string) { return console.error(consoleDescription); // silence EPROTO errors - if (error.code == "EPROTO") return console.error(consoleDescription); + if (error.code === "EPROTO") return console.error(consoleDescription); // DO NOT DELETE THIS CATCH, IT AVOIDS INFINITE LOOP IF THIS PROMISE REJECTS devLogger(client, embedDescription, { title: type, codeBlocks }).catch(console.error); diff --git a/src/functions/images/magnify.ts b/src/functions/images/magnify.ts index 07a60f83..24e058cf 100644 --- a/src/functions/images/magnify.ts +++ b/src/functions/images/magnify.ts @@ -17,7 +17,7 @@ export async function magnify(origin: ImageSource, isAnimation = false) { const surface = isAnimation ? input.width * 16 : input.width * input.height; let factor = 64; - if (surface == 256) factor = 32; + if (surface === 256) factor = 32; if (surface > 256) factor = 16; if (surface > 1024) factor = 8; if (surface > 4096) factor = 4; diff --git a/src/functions/images/palette.ts b/src/functions/images/palette.ts index a8f1f4a1..f3bb62e2 100644 --- a/src/functions/images/palette.ts +++ b/src/functions/images/palette.ts @@ -113,7 +113,7 @@ export default async function palette(interaction: AnyInteraction, origin: Image // create palette links, 9 max per link // make arrays of hex arrays - const paletteGroups = []; + const paletteGroups: string[][] = []; for (let i = 0; i < colors.length; ++i) { if (i % COLORS_PER_PALETTE === 0) paletteGroups.push([]); paletteGroups.at(-1).push(colors[i].replace("#", "")); diff --git a/src/functions/images/stitch.ts b/src/functions/images/stitch.ts index ead7e193..96376634 100644 --- a/src/functions/images/stitch.ts +++ b/src/functions/images/stitch.ts @@ -8,12 +8,12 @@ import { createCanvas, Image } from "@napi-rs/canvas"; * @returns stitched texture and the gap length added */ export default async function stitch(images: Image[], gap?: number): Promise<[Buffer, number]> { - const biggestImage = images.reduce((a, e) => (a.width > e.width ? a : e), { + const biggestImage = images.reduce((best, cur) => (best.width > cur.width ? best : cur), { width: 0, height: 0, }); - if (gap == null || gap == undefined) { + if (gap === null || gap === undefined) { // the gap should be the size of one 16x "pixel" gap = 1; if (biggestImage.width > 16) gap = 2; diff --git a/src/functions/submission/handleResults.ts b/src/functions/submission/handleResults.ts index 6b4598b9..3adb63ac 100644 --- a/src/functions/submission/handleResults.ts +++ b/src/functions/submission/handleResults.ts @@ -95,11 +95,12 @@ export async function downloadTexture( return; } - const imageFile = (await axios.get(texture.url, { responseType: "arraybuffer" })).data; + const imageFile = (await axios.get(texture.url, { responseType: "arraybuffer" })).data; let textureInfo: Texture; try { - textureInfo = (await axios.get(`${process.env.API_URL}textures/${texture.id}/all`)).data; + textureInfo = (await axios.get(`${process.env.API_URL}textures/${texture.id}/all`)) + .data; } catch { // handles if texture gets deleted in the db between submission and results (merged, obsolete, etc) if (DEBUG) console.error(`Could not find texture for ID: ${texture.id}`); @@ -108,7 +109,7 @@ export async function downloadTexture( // add the image to all its versions and paths for (const use of textureInfo.uses) { - const paths = textureInfo.paths.filter((path) => path.use == use.id); + const paths = textureInfo.paths.filter((path) => path.use === use.id); // need to redefine pack folder every time since java/bedrock are different folders const packFolder = pack.github[use.edition]?.repo; diff --git a/src/functions/submission/makeEmbed.ts b/src/functions/submission/makeEmbed.ts index cd412704..4c8782f9 100644 --- a/src/functions/submission/makeEmbed.ts +++ b/src/functions/submission/makeEmbed.ts @@ -141,7 +141,7 @@ export default async function makeEmbed( * @returns usable embed field data */ export function addPathsToEmbed(texture: Texture): APIEmbedField[] { - const groupedPaths: Partial> = texture.uses.reduce( + const groupedPaths = texture.uses.reduce>>( (acc, use) => { const paths = texture.paths .filter((el) => el.use === use.id) diff --git a/src/functions/submission/reactionMenu.ts b/src/functions/submission/reactionMenu.ts index 1b29cb11..b5fae0a9 100644 --- a/src/functions/submission/reactionMenu.ts +++ b/src/functions/submission/reactionMenu.ts @@ -33,7 +33,7 @@ export default async function reactionMenu(openReaction: MessageReaction, user: const submissionAuthorID = message.embeds[0].fields[0].value.split("\n")[0].replace(/\D+/g, ""); // if you don't check to close tray first, the bot won't listen for reactions upon restart - if (openReaction.emoji.id == settings.emojis.see_less) return closeTray(message, allReactions); + if (openReaction.emoji.id === settings.emojis.see_less) return closeTray(message, allReactions); if (!canOpenTray(message, openReaction, member, submissionAuthorID)) return; @@ -69,7 +69,7 @@ export default async function reactionMenu(openReaction: MessageReaction, user: const reactor = Array.from(actionReaction.users.cache.values()).find((user) => !user.bot); if ( - actionReaction.emoji.id == settings.emojis.delete && + actionReaction.emoji.id === settings.emojis.delete && // only admins can delete messages (prevent abuse) (reactor.id === submissionAuthorID || hasPermission(member, "administrator")) && message.deletable @@ -137,7 +137,7 @@ function filterReactions(message: Message, member: GuildMember, allReactions: st const packs: PackFile = require("@resources/packs.json"); // if the submission is in council remove delete reaction (avoid misclick) - if (Object.values(packs).some((pack) => pack.submission.channels.council == message.channel.id)) + if (Object.values(packs).some((pack) => pack.submission.channels.council === message.channel.id)) allReactions = allReactions.filter((emoji) => emoji !== settings.emojis.delete); // remove instapass/invalid if just the author is reacting or if submission is no longer pending diff --git a/src/functions/submission/submitTexture.ts b/src/functions/submission/submitTexture.ts index f7043295..d4d97a17 100644 --- a/src/functions/submission/submitTexture.ts +++ b/src/functions/submission/submitTexture.ts @@ -54,7 +54,7 @@ export default async function submitTexture(message: Message) { let results: Texture[] = []; try { - results = (await axios.get(`${process.env.API_URL}textures/${search}/all`)).data; + results = (await axios.get(`${process.env.API_URL}textures/${search}/all`)).data; } catch { await cancelSubmission(message, strings.submission.does_not_exist + "\n" + search); continue; @@ -68,7 +68,7 @@ export default async function submitTexture(message: Message) { continue; } - if (results.length == 1) { + if (results.length === 1) { await makeEmbed(message, results[0], attachment, param); continue; } diff --git a/src/functions/submission/utility/choiceEmbed.ts b/src/functions/submission/utility/choiceEmbed.ts index 4d51b488..ab7481fe 100644 --- a/src/functions/submission/utility/choiceEmbed.ts +++ b/src/functions/submission/utility/choiceEmbed.ts @@ -12,6 +12,7 @@ import { Message, SelectMenuComponentOptionData, StringSelectMenuInteraction, + ComponentType, } from "discord.js"; import { hasPermission } from "@helpers/permissions"; import axios from "axios"; @@ -60,15 +61,17 @@ export default async function choiceEmbed( const choiceMessage = await message.reply({ embeds: [embed], components: components }); await addDeleteButton(choiceMessage); - // typed as any since we know it's a string select menu but discord.js doesn't - const filter: any = (interaction: StringSelectMenuInteraction) => + const filter = (interaction: StringSelectMenuInteraction) => // format is choiceEmbed_ (needs unique ids) interaction.customId.startsWith("choiceEmbed") && - interaction.message.id == choiceMessage.id && + interaction.message.id === choiceMessage.id && // admins can interact with choice embeds always - (interaction.user.id == message.author.id || hasPermission(message.member, "administrator")); + (interaction.user.id === message.author.id || hasPermission(message.member, "administrator")); - const collector = message.channel.createMessageComponentCollector({ filter, time: 60000 }); + const collector = message.channel.createMessageComponentCollector({ + filter, + time: 60000, + }); collector.once("collect", async (interaction: StringSelectMenuInteraction) => { if (!message.deletable) { @@ -86,7 +89,7 @@ export default async function choiceEmbed( authors: await getAuthors(message), }; - const texture: Texture = (await axios.get(`${process.env.API_URL}textures/${id}/all`)).data; + const texture = (await axios.get(`${process.env.API_URL}textures/${id}/all`)).data; if (choiceMessage.deletable) await choiceMessage.delete(); return makeEmbed(message, texture, attachments[index], param); diff --git a/src/functions/submission/utility/generateComparison.ts b/src/functions/submission/utility/generateComparison.ts index e6943e1c..7110cb8e 100644 --- a/src/functions/submission/utility/generateComparison.ts +++ b/src/functions/submission/utility/generateComparison.ts @@ -32,8 +32,8 @@ export default async function generateComparison( /** * [Reference, New, Current?] */ - const images: Image[] = ( - await Promise.all([ + const images = ( + await Promise.all([ loadImage(`${baseURL}${reference}/latest`) // fall back to default if reference doesn't exist .catch(() => loadImage(`${baseURL}default/latest`)) @@ -82,7 +82,7 @@ export default async function generateComparison( return { comparisonImage: new AttachmentBuilder(animated, { name: "compared.gif" }), - hasReference: images.length == 3, + hasReference: images.length === 3, mcmeta: displayedMcmeta, }; } diff --git a/src/functions/submission/utility/getAuthors.ts b/src/functions/submission/utility/getAuthors.ts index 566ecffa..07f96360 100644 --- a/src/functions/submission/utility/getAuthors.ts +++ b/src/functions/submission/utility/getAuthors.ts @@ -17,7 +17,7 @@ export default async function getAuthors(message: Message) { ?.map((name) => name.toLowerCase().trim()); if (names?.length) { - const users: User[] = (await axios.get(`${process.env.API_URL}users/names`)).data; + const users = (await axios.get(`${process.env.API_URL}users/names`)).data; for (const user of users) if (names.includes(user.username?.toLowerCase()) && !authors.includes(user.id)) authors.push(user.id); diff --git a/src/functions/submission/utility/getPackByChannel.ts b/src/functions/submission/utility/getPackByChannel.ts index 63a25ef6..bc97d228 100644 --- a/src/functions/submission/utility/getPackByChannel.ts +++ b/src/functions/submission/utility/getPackByChannel.ts @@ -17,8 +17,8 @@ export default function getPackByChannel( // more annoying to use .find since we're only returning the key for (const [packKey, packValue] of Object.entries(packs)) { - if (packValue.submission.channels?.[channelType] == channelID) return packKey; - if (Object.values(packValue.submission.channels).includes(channelID) && channelType == "any") + if (packValue.submission.channels?.[channelType] === channelID) return packKey; + if (Object.values(packValue.submission.channels).includes(channelID) && channelType === "any") return packKey; } } diff --git a/src/functions/submission/utility/retrieveSubmission.ts b/src/functions/submission/utility/retrieveSubmission.ts index a9808005..36c03d8a 100644 --- a/src/functions/submission/utility/retrieveSubmission.ts +++ b/src/functions/submission/utility/retrieveSubmission.ts @@ -34,9 +34,9 @@ export default async function retrieveSubmission(client: Client, channelID: stri const messageDate = new Date(message.createdTimestamp); return ( // correct date - messageDate.getDate() == delayedDate.getDate() && - messageDate.getMonth() == delayedDate.getMonth() && - messageDate.getFullYear() == delayedDate.getFullYear() && + messageDate.getDate() === delayedDate.getDate() && + messageDate.getMonth() === delayedDate.getMonth() && + messageDate.getFullYear() === delayedDate.getFullYear() && // only get pending submissions message.embeds?.[0]?.fields[1]?.value?.includes(settings.emojis.pending) ); @@ -59,7 +59,7 @@ export default async function retrieveSubmission(client: Client, channelID: stri return ( upvoteCount > downvoteCount || // if nobody voted assume nobody cares - (upvoteCount == 1 && downvoteCount == 1) + (upvoteCount === 1 && downvoteCount === 1) ); });