diff --git a/src/lib/utils.js b/src/lib/utils.js index 225fb4e..d1089b4 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -96,7 +96,7 @@ async function findLastImage(msg, gif = false) { }); } -const urlRegex = /((https?):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+)/; +const urlRegex = /((https?):\/)?\/?([^:/\s]+)((\/\w+)*\/)([\w\-.]+)/; async function getImage(msg, str) { const img = await findLastImage(msg, false); @@ -112,7 +112,7 @@ async function getImage(msg, str) { const id = str.match(//)[1]; return `https://cdn.discordapp.com/emojis/${id}.png?v=1`; } else if (/<@!?([0-9]*)>/.test(str)) { - const id = url.match(/<@?!([0-9]*)>/)[1]; + const id = str.match(/<@?!([0-9]*)>/)[1]; const user = await hf.bot.requestHandler.request( "GET", "/users/" + id,