rudimentary invite link because link in bot profile doesnt work

This commit is contained in:
derpystuff 2022-12-16 20:03:23 +01:00
parent 8f3a206838
commit e09140cd6b

View file

@ -16,6 +16,9 @@ module.exports = {
},
run: async (context, args) => {
context.triggerTyping();
if(!args.invite) return editOrReply(context, createEmbed("default", context, {
description: icon("link") + " You can invite the bot with [this](https://discord.com/api/oauth2/authorize?client_id=682654466453012553&permissions=412317247552&scope=bot%20applications.commands) link."
}))
try{
const inviteCode = args.invite.match(/(?:(?:https|http):\/\/)?(?:(?:discord.gg|(?:discord|discordapp)\.com\/invite)\/)?([A-z0-z-]{2,32})/)
const invite = await context.client.rest.fetchInvite(inviteCode[1], {withCounts: true})