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.usage = "<invite code>";
|
||||
lookupinvite.addAlias("linvite");
|
||||
lookupinvite.callback = async function (msg, line, [code]) {
|
||||
if (!code) {
|
||||
lookupinvite.callback = async function (msg, line) {
|
||||
if (!line || line == "") {
|
||||
return "No arguments passed.";
|
||||
}
|
||||
|
||||
const invite = await hf.bot.requestHandler.request({
|
||||
method: "GET",
|
||||
path: `/invites/${code.replace(
|
||||
/(https?:\/\/)?discord\.gg\//,
|
||||
""
|
||||
)}?with_counts=1`,
|
||||
path: `/invites/${line}?with_counts=1`,
|
||||
});
|
||||
if (!invite) return ":warning: No data returned.";
|
||||
|
||||
|
|
Loading…
Reference in a new issue