diff options
| author | Alee14 <Alee14498@gmail.com> | 2017-07-28 16:20:27 -0400 |
|---|---|---|
| committer | Alee14 <Alee14498@gmail.com> | 2017-07-28 16:20:27 -0400 |
| commit | d35e0862e6b60fe3c4f823371627359f3ce3e68b (patch) | |
| tree | d98b788eb1abf0a8814207b993b4e22efe711deb /node_modules/discord.js/src/structures/TextChannel.js | |
| parent | 20993df62e7e38ed43428aafa5981afc3543bdea (diff) | |
| download | AleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.tar.gz AleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.tar.bz2 AleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.zip | |
Removing node modules (go get them yourself :P)
Diffstat (limited to 'node_modules/discord.js/src/structures/TextChannel.js')
| -rw-r--r-- | node_modules/discord.js/src/structures/TextChannel.js | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/node_modules/discord.js/src/structures/TextChannel.js b/node_modules/discord.js/src/structures/TextChannel.js deleted file mode 100644 index 9697abd..0000000 --- a/node_modules/discord.js/src/structures/TextChannel.js +++ /dev/null @@ -1,96 +0,0 @@ -const GuildChannel = require('./GuildChannel'); -const TextBasedChannel = require('./interface/TextBasedChannel'); -const Collection = require('../util/Collection'); - -/** - * Represents a guild text channel on Discord. - * @extends {GuildChannel} - * @implements {TextBasedChannel} - */ -class TextChannel extends GuildChannel { - constructor(guild, data) { - super(guild, data); - this.type = 'text'; - this.messages = new Collection(); - this._typing = new Map(); - } - - setup(data) { - super.setup(data); - - /** - * The topic of the text channel, if there is one. - * @type {?string} - */ - this.topic = data.topic; - - this.lastMessageID = data.last_message_id; - } - - /** - * A collection of members that can see this channel, mapped by their ID. - * @type {Collection<string, GuildMember>} - * @readonly - */ - get members() { - const members = new Collection(); - for (const member of this.guild.members.values()) { - if (this.permissionsFor(member).hasPermission('READ_MESSAGES')) { - members.set(member.id, member); - } - } - return members; - } - - /** - * Fetch all webhooks for the channel. - * @returns {Promise<Collection<string, Webhook>>} - */ - fetchWebhooks() { - return this.client.rest.methods.getChannelWebhooks(this); - } - - /** - * Create a webhook for the channel. - * @param {string} name The name of the webhook. - * @param {BufferResolvable} avatar The avatar for the webhook. - * @returns {Promise<Webhook>} webhook The created webhook. - * @example - * channel.createWebhook('Snek', 'http://snek.s3.amazonaws.com/topSnek.png') - * .then(webhook => console.log(`Created Webhook ${webhook}`)) - * .catch(console.error) - */ - createWebhook(name, avatar) { - return new Promise(resolve => { - if (avatar.startsWith('data:')) { - resolve(this.client.rest.methods.createWebhook(this, name, avatar)); - } else { - this.client.resolver.resolveBuffer(avatar).then(data => - resolve(this.client.rest.methods.createWebhook(this, name, data)) - ); - } - }); - } - - // These are here only for documentation purposes - they are implemented by TextBasedChannel - send() { return; } - sendMessage() { return; } - sendEmbed() { return; } - sendFile() { return; } - sendCode() { return; } - fetchMessage() { return; } - fetchMessages() { return; } - fetchPinnedMessages() { return; } - startTyping() { return; } - stopTyping() { return; } - get typing() { return; } - get typingCount() { return; } - createCollector() { return; } - awaitMessages() { return; } - bulkDelete() { return; } - _cacheMessage() { return; } -} - -TextBasedChannel.applyToClass(TextChannel, true); - -module.exports = TextChannel; |
