utility.linvite: try 3
This commit is contained in:
parent
ad3700bb82
commit
0834adf6e9
1 changed files with 3 additions and 6 deletions
|
@ -271,17 +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, [code]) {
|
lookupinvite.callback = async function (msg, line) {
|
||||||
if (!code) {
|
if (!line || line == "") {
|
||||||
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/${code.replace(
|
path: `/invites/${line}?with_counts=1`,
|
||||||
/(https?:\/\/)?discord\.gg\//,
|
|
||||||
""
|
|
||||||
)}?with_counts=1`,
|
|
||||||
});
|
});
|
||||||
if (!invite) return ":warning: No data returned.";
|
if (!invite) return ":warning: No data returned.";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue