utility.linvite: try 2

This commit is contained in:
Cynthia Foxwell 2023-01-26 22:49:56 -07:00
parent 26fb765387
commit ad3700bb82

View file

@ -271,14 +271,14 @@ lookupinvite.category = CATEGORY;
lookupinvite.helpText = "Lookup an invite"; lookupinvite.helpText = "Lookup an invite";
lookupinvite.usage = "<invite code>"; lookupinvite.usage = "<invite code>";
lookupinvite.addAlias("linvite"); lookupinvite.addAlias("linvite");
lookupinvite.callback = async function (msg, line) { lookupinvite.callback = async function (msg, line, [code]) {
if (!line) { if (!code) {
return "No arguments passed."; return "No arguments passed.";
} }
const invite = await hf.bot.requestHandler.request({ const invite = await hf.bot.requestHandler.request({
method: "GET", method: "GET",
path: `/invites/${line.replace( path: `/invites/${code.replace(
/(https?:\/\/)?discord\.gg\//, /(https?:\/\/)?discord\.gg\//,
"" ""
)}?with_counts=1`, )}?with_counts=1`,