Files
discord.js/src/structures/TextChannel.js
2016-09-07 02:07:39 -04:00

50 lines
1.3 KiB
JavaScript

const GuildChannel = require('./GuildChannel');
const TextBasedChannel = require('./interface/TextBasedChannel');
const Collection = require('../util/Collection');
/**
* Represents a Server Text Channel on Discord.
* @extends {GuildChannel}
* @implements {TextBasedChannel}
*/
class TextChannel extends GuildChannel {
constructor(guild, data) {
super(guild, data);
this.messages = new Collection();
}
setup(data) {
super.setup(data);
/**
* The topic of the Text Channel, if there is one.
* @type {?string}
*/
this.topic = data.topic;
this.type = 'text';
this.lastMessageID = data.last_message_id;
this._typing = new Map();
}
// These are here only for documentation purposes - they are implemented by TextBasedChannel
sendMessage() { return; }
sendTTSMessage() { return; }
sendFile() { 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;