From 2922120c9b6e35226b9e03ac30dcf39b88849962 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 18 Feb 2022 13:37:14 -0500 Subject: refactor: use client.generateInvite for invite --- src/lib/extensions/discord-akairo/BushClientUtil.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index bf4dfaf..4184723 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -21,7 +21,7 @@ import assert from 'assert'; import { exec } from 'child_process'; import deepLock from 'deep-lock'; import { ClientUtil, Util as AkairoUtil } from 'discord-akairo'; -import type { APIMessage } from 'discord-api-types/v9'; +import { APIMessage, OAuth2Scopes } from 'discord-api-types/v9'; import { Constants as DiscordConstants, GuildMember, @@ -911,10 +911,10 @@ export class BushClientUtil extends ClientUtil { * The link to invite the bot with all permissions. */ public get invite() { - return `https://discord.com/api/oauth2/authorize?client_id=${Buffer.from( - client.token!.split('.')[0], - 'base64' - ).toString()}&permissions=${PermissionsBitField.All}&scope=bot%20applications.commands`; + return client.generateInvite({ + permissions: PermissionsBitField.All, + scopes: [OAuth2Scopes.Bot, OAuth2Scopes.ApplicationsCommands] + }); } public assertAll(...args: any[]): void { -- cgit