Files
discord.js/src/structures/PartialGuild.js
Schuyler Cebulskie b7f582b7f0 Clean up a bunch of stuff
- Channel typing data is now a Map
- Client properties on structures are now non-enumerable and
non-configurable
2016-09-07 00:24:45 -04:00

51 lines
989 B
JavaScript

/*
{ splash: null,
id: '123123123',
icon: '123123123',
name: 'name' }
*/
/**
* Represents a Guild that the client only has limited information for - e.g. from invites.
*/
class PartialGuild {
constructor(client, data) {
/**
* The client that instantiated this PartialGuild
* @type {Client}
*/
this.client = client;
Object.defineProperty(this, 'client', { enumerable: false, configurable: false });
this.setup(data);
}
setup(data) {
/**
* The ID of this guild
* @type {string}
*/
this.id = data.id;
/**
* The name of this guild
* @type {string}
*/
this.name = data.name;
/**
* The hash of this guild's icon, or null if there is none.
* @type {?string}
*/
this.icon = data.icon;
/**
* The hash of the guild splash image, or null if no splash (VIP only)
* @type {?string}
*/
this.splash = data.splash;
}
}
module.exports = PartialGuild;