From 44d6d914590231ecad5b926c7f06e27cd584aa0b Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Mon, 6 Mar 2023 18:26:41 -0700 Subject: [PATCH] utils: forgor auth --- src/lib/utils.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib/utils.js b/src/lib/utils.js index 3c4ec73..147e254 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -113,7 +113,11 @@ async function getImage(msg, str) { return `https://cdn.discordapp.com/emojis/${id}.png?v=1`; } else if (/<@!?([0-9]*)>/.test(refMsg.content)) { const id = refMsg.content.match(/<@!?([0-9]*)>/)[1]; - const user = await hf.bot.requestHandler.request("GET", "/users/" + id); + const user = await hf.bot.requestHandler.request( + "GET", + "/users/" + id, + true + ); if (user) return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`; } @@ -133,7 +137,11 @@ async function getImage(msg, str) { return `https://cdn.discordapp.com/emojis/${id}.png?v=1`; } else if (/<@!?([0-9]*)>/.test(str)) { const id = str.match(/<@!?([0-9]*)>/)[1]; - const user = await hf.bot.requestHandler.request("GET", "/users/" + id); + const user = await hf.bot.requestHandler.request( + "GET", + "/users/" + id, + true + ); if (user) return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`; } else if (img) { @@ -273,7 +281,8 @@ async function lookupUser(msg, str, filter) { if (/[0-9]{17,21}/.test(str)) { return await hf.bot.requestHandler.request( "GET", - "/users/" + str.match(/([0-9]{17,21})/)[1] + "/users/" + str.match(/([0-9]{17,21})/)[1], + true ); }