zumito-framework 1.2.22 → 1.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class InviteUrlGenerator {
|
|
2
|
+
generateBotInviteUrl(clientId, permissions) {
|
|
3
|
+
if (!clientId) {
|
|
4
|
+
clientId = process.env.DISCORD_CLIENT_ID;
|
|
5
|
+
}
|
|
6
|
+
if (!permissions) {
|
|
7
|
+
permissions = 0;
|
|
8
|
+
}
|
|
9
|
+
if (!clientId)
|
|
10
|
+
throw new Error('Client ID is not defined');
|
|
11
|
+
if (!permissions)
|
|
12
|
+
throw new Error('Permissions are not defined');
|
|
13
|
+
return `https://discord.com/api/oauth2/authorize?client_id=${clientId}&permissions=${permissions}&scope=bot`;
|
|
14
|
+
}
|
|
15
|
+
}
|