diff --git a/src/lib/utils.js b/src/lib/utils.js index e5b508d..3c4ec73 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -113,10 +113,7 @@ 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.rest.authRequest({ - method: "GET", - path: "/users/" + id, - }); + const user = await hf.bot.requestHandler.request("GET", "/users/" + id); if (user) return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`; } @@ -136,10 +133,7 @@ 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.rest.authRequest({ - method: "GET", - path: "/users/" + id, - }); + const user = await hf.bot.requestHandler.request("GET", "/users/" + id); if (user) return `https://cdn.discordapp.com/avatars/${id}/${user.avatar}.png?size=1024`; } else if (img) { @@ -277,10 +271,10 @@ async function selectionMessage( async function lookupUser(msg, str, filter) { if (/[0-9]{17,21}/.test(str)) { - return await hf.bot.rest.authRequest({ - method: "GET", - path: "/users/" + str.match(/([0-9]{17,21})/)[1], - }); + return await hf.bot.requestHandler.request( + "GET", + "/users/" + str.match(/([0-9]{17,21})/)[1] + ); } let users;