mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 14:41:36 +00:00
Webpack build for branch 11.3-dev: c387e96078
This commit is contained in:
parent
d76989a3f2
commit
eb26e2e3fd
2 changed files with 5 additions and 10 deletions
|
|
@ -17269,20 +17269,15 @@ class Client extends EventEmitter {
|
|||
/**
|
||||
* Generates a link that can be used to invite the bot to a guild.
|
||||
* <warn>This is only available when using a bot account.</warn>
|
||||
* @param {PermissionResolvable[]|number} [permissions] Permissions to request
|
||||
* @param {PermissionResolvable|PermissionResolvable[]} [permissions] Permissions to request
|
||||
* @returns {Promise<string>}
|
||||
* @example
|
||||
* client.generateInvite(['SEND_MESSAGES', 'MANAGE_GUILD', 'MENTION_EVERYONE'])
|
||||
* .then(link => {
|
||||
* console.log(`Generated bot invite link: ${link}`);
|
||||
* });
|
||||
* .then(link => console.log(`Generated bot invite link: ${link}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
generateInvite(permissions) {
|
||||
if (permissions) {
|
||||
if (permissions instanceof Array) permissions = Permissions.resolve(permissions);
|
||||
} else {
|
||||
permissions = 0;
|
||||
}
|
||||
permissions = typeof permissions === 'undefined' ? 0 : Permissions.resolve(permissions);
|
||||
return this.fetchApplication().then(application =>
|
||||
`https://discordapp.com/oauth2/authorize?client_id=${application.id}&permissions=${permissions}&scope=bot`
|
||||
);
|
||||
|
|
|
|||
2
discord.11.3-dev.min.js
vendored
2
discord.11.3-dev.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue