mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Added guildChannel.createInvite();
This commit is contained in:
39
src/structures/PartialGuildChannel.js
Normal file
39
src/structures/PartialGuildChannel.js
Normal file
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user