summaryrefslogtreecommitdiff
path: root/node_modules/discord.js/src/structures/OAuth2Guild.js
blob: d5104ac7a658934420fe77b90d236c037faae5ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict';

const BaseGuild = require('./BaseGuild');
const PermissionsBitField = require('../util/PermissionsBitField');

/**
 * A partial guild received when using {@link GuildManager#fetch} to fetch multiple guilds.
 * @extends {BaseGuild}
 */
class OAuth2Guild extends BaseGuild {
  constructor(client, data) {
    super(client, data);

    /**
     * Whether the client user is the owner of the guild
     * @type {boolean}
     */
    this.owner = data.owner;

    /**
     * The permissions that the client user has in this guild
     * @type {Readonly<PermissionsBitField>}
     */
    this.permissions = new PermissionsBitField(BigInt(data.permissions)).freeze();
  }
}

module.exports = OAuth2Guild;