async generateInvite(options = {}) {
    if (Array.isArray(options) || ['string', 'number'].includes(typeof options) || options instanceof Permissions) {
      process.emitWarning(
        'Client#generateInvite: Generate invite with an options object instead of a PermissionResolvable',
        'DeprecationWarning',
      );
      options = { permissions: options };
    }
    const application = await this.fetchApplication();
    const query = new URLSearchParams({
      client_id: application.id,
      permissions: Permissions.resolve(options.permissions),
      scope: 'bot',
    });
    if (typeof options.disableGuildSelect === 'boolean') {
      query.set('disable_guild_select', options.disableGuildSelect.toString());
    }
    if (typeof options.guild !== 'undefined') {
      const guildID = this.guilds.resolveID(options.guild);
      if (!guildID) throw new TypeError('INVALID_TYPE', 'options.guild', 'GuildResolvable');
      query.set('guild_id', guildID);
    }
    return `${this.options.http.api}${this.api.oauth2.authorize}?${query}`;
  }
/**
   * Generates a link that can be used to invite the bot to a guild.
   * @param {InviteGenerationOptions|PermissionResolvable} [options] Permissions to request
   * @returns {Promise<string>}
   * @example
   * client.generateInvite({
   *   permissions: ['SEND_MESSAGES', 'MANAGE_GUILD', 'MENTION_EVERYONE'],
   * })
   *   .then(link => console.log(`Generated bot invite link: ${link}`))
   *   .catch(console.error);
   */
Generates a link that can be used to invite the bot to a guild.
Generates a link that can be used to invite the bot to a guild .
async generateInvite(options = {}) {
    if (Array.isArray(options) || ['string', 'number'].includes(typeof options) || options instanceof Permissions) {
      process.emitWarning(
        'Client#generateInvite: Generate invite with an options object instead of a PermissionResolvable',
        'DeprecationWarning',
      );
      options = { permissions: options };
    }
    const application = await this.fetchApplication();
    const query = new URLSearchParams({
      client_id: application.id,
      permissions: Permissions.resolve(options.permissions),
      scope: 'bot',
    });
    if (typeof options.disableGuildSelect === 'boolean') {
      query.set('disable_guild_select', options.disableGuildSelect.toString());
    }
    if (typeof options.guild !== 'undefined') {
      const guildID = this.guilds.resolveID(options.guild);
      if (!guildID) throw new TypeError('INVALID_TYPE', 'options.guild', 'GuildResolvable');
      query.set('guild_id', guildID);
    }
    return `${this.options.http.api}${this.api.oauth2.authorize}?${query}`;
  }
async generateInvite ( options = { } ) { if ( Array . isArray ( options ) || [ 'string' , 'number' ] . includes ( typeof options ) || options instanceof Permissions ) { process . emitWarning ( 'Client#generateInvite: Generate invite with an options object instead of a PermissionResolvable' , 'DeprecationWarning' , ) ; options = { permissions : options } ; } const application = await this . fetchApplication ( ) ; const query = new URLSearchParams ( { client_id : application . id , permissions : Permissions . resolve ( options . permissions ) , scope : 'bot' , } ) ; if ( typeof options . disableGuildSelect === 'boolean' ) { query . set ( 'disable_guild_select' , options . disableGuildSelect . toString ( ) ) ; } if ( typeof options . guild !== 'undefined' ) { const guildID = this . guilds . resolveID ( options . guild ) ; if ( ! guildID ) throw new TypeError ( 'INVALID_TYPE' , 'options.guild' , 'GuildResolvable' ) ; query . set ( 'guild_id' , guildID ) ; } return ` ${ this . options . http . api } ${ this . api . oauth2 . authorize } ${ query } ` ; }
Generates a link that can be used to invite the bot to a guild.
Generates a link that can be used to invite the bot to a guild .