aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo/BushClientUtil.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-26 21:40:27 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-26 21:40:27 -0500
commit3b008e3997bac2093cc8b4254328ec84acc7e294 (patch)
tree22ac3c43b53c2bd0382541de37530f944bd9c721 /src/lib/extensions/discord-akairo/BushClientUtil.ts
parent840cca672d681c36f980a06fb79a4e2c01bd69ac (diff)
downloadtanzanite-3b008e3997bac2093cc8b4254328ec84acc7e294.tar.gz
tanzanite-3b008e3997bac2093cc8b4254328ec84acc7e294.tar.bz2
tanzanite-3b008e3997bac2093cc8b4254328ec84acc7e294.zip
minor changes
Diffstat (limited to 'src/lib/extensions/discord-akairo/BushClientUtil.ts')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index 968a805..e3c0803 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -793,8 +793,9 @@ export class BushClientUtil extends ClientUtil {
public clientSendAndPermCheck(message: BushMessage | BushSlashMessage, permissions: bigint[] = [], checkChannel = false) {
const missing = [];
const sendPerm = message.channel!.isThread() ? Permissions.FLAGS.SEND_MESSAGES : Permissions.FLAGS.SEND_MESSAGES_IN_THREADS;
+ if (!message.inGuild()) return null;
- if (!message.guild!.me!.permissionsIn(message.channel!.id!).has(sendPerm)) missing.push(sendPerm);
+ if (!message.guild.me!.permissionsIn(message.channel.id).has(sendPerm)) missing.push(sendPerm);
missing.push(
...(checkChannel
@@ -867,15 +868,14 @@ export class BushClientUtil extends ClientUtil {
return deepLock;
}
- public get time(): Record<keyof typeof client.constants.timeUnits, number> {
- const values = Object.entries(client.constants.timeUnits).map(([key, value]) => [key, value.value]);
- return Object.fromEntries(values);
- }
-
+ /**
+ * The link to invite the bot with all permissions.
+ */
public get invite() {
- return `https://discord.com/api/oauth2/authorize?client_id=${client.user!.id}&permissions=${
- Permissions.ALL
- }&scope=bot%20applications.commands`;
+ return `https://discord.com/api/oauth2/authorize?client_id=${Buffer.from(
+ client.token!.split('.')[0],
+ 'base64'
+ ).toString()}&permissions=${Permissions.ALL}&scope=bot%20applications.commands`;
}
/**