From 26fb765387f6e381ece528edbf4a32957aa1df91 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Thu, 26 Jan 2023 22:46:19 -0700 Subject: [PATCH] utility.linvite: attempt replace fix --- src/modules/utility.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/modules/utility.js b/src/modules/utility.js index c0ce938..e6e95c5 100644 --- a/src/modules/utility.js +++ b/src/modules/utility.js @@ -276,11 +276,12 @@ lookupinvite.callback = async function (msg, line) { return "No arguments passed."; } - line = line.replace(/(https?:\/\/)?discord\.gg\//, ""); - const invite = await hf.bot.requestHandler.request({ method: "GET", - path: "/invites/" + line + "?with_counts=1", + path: `/invites/${line.replace( + /(https?:\/\/)?discord\.gg\//, + "" + )}?with_counts=1`, }); if (!invite) return ":warning: No data returned."; @@ -501,16 +502,16 @@ flagdump.callback = async function (msg, line, [numOrMention], {id}) { if (!user) { return "User not cached."; } else { - return `\`${user.username}#${user.discriminator}\`'s public flags:\n\`\`\`${flagFromInt( - user.publicFlags - )}\`\`\``; + return `\`${user.username}#${ + user.discriminator + }\`'s public flags:\n\`\`\`${flagFromInt(user.publicFlags)}\`\`\``; } } else if (!isNaN(num)) { return `\`\`\`\n${flagFromInt(num)}\`\`\``; } else { - return `\`${msg.author.username}#${msg.author.discriminator}\`'s public flags:\n\`\`\`${flagFromInt( - msg.author.publicFlags - )}\`\`\``; + return `\`${msg.author.username}#${ + msg.author.discriminator + }\`'s public flags:\n\`\`\`${flagFromInt(msg.author.publicFlags)}\`\`\``; } }; hf.registerCommand(flagdump); @@ -710,7 +711,8 @@ presence.callback = async function (msg, line) { } if (target) { - if (!target.clientStatus) return `**${target.username}#${target.discriminator}** is offline.`; + if (!target.clientStatus) + return `**${target.username}#${target.discriminator}** is offline.`; let icons = ""; for (const platform of Object.keys(target.clientStatus)) { @@ -902,7 +904,9 @@ presence.callback = async function (msg, line) { } return { - content: `Presence for **${target.username}#${target.discriminator}**: ${icons.trim()}`, + content: `Presence for **${target.username}#${ + target.discriminator + }**: ${icons.trim()}`, embeds, files, };