aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-18 13:37:14 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-18 13:37:14 -0500
commit2922120c9b6e35226b9e03ac30dcf39b88849962 (patch)
tree229b37e0abeeaa55e9437a0f638933c35deba2db /src
parent43428f8a747f1b3e6b2a3418173910ce3ff1866c (diff)
downloadtanzanite-2922120c9b6e35226b9e03ac30dcf39b88849962.tar.gz
tanzanite-2922120c9b6e35226b9e03ac30dcf39b88849962.tar.bz2
tanzanite-2922120c9b6e35226b9e03ac30dcf39b88849962.zip
refactor: use client.generateInvite for invite
Diffstat (limited to 'src')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts10
1 files changed, 5 insertions, 5 deletions
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 {