Files
discord.js/src/structures/PartialGuildChannel.js
2016-08-28 20:32:37 +01:00

40 lines
860 B
JavaScript

const Constants = require('../util/Constants');
/*
{ type: 0, id: '123123', name: 'heavy-testing' } }
*/
/**
* Represents a Guild Channel that the client only has limited information for - e.g. from invites.
*/
class PartialGuildChannel {
constructor(client, data) {
/**
* The client that instantiated this PartialGuildChannel
* @type {Client}
*/
this.client = client;
this.setup(data);
}
setup(data) {
/**
* The ID of this Guild Channel
* @type {String}
*/
this.id = data.id;
/**
* The name of this Guild Channel
* @type {String}
*/
this.name = data.name;
/**
* The type of this Guild Channel - `text` or `voice`
* @type {String}
*/
this.type = Constants.ChannelTypes.text === data.type ? 'text' : 'voice';
}
}
module.exports = PartialGuildChannel;