Write some more docs

This commit is contained in:
Amish Shah
2016-08-17 23:46:58 +01:00
parent 562e3b119e
commit c37191b582
4 changed files with 85 additions and 2 deletions

View File

@@ -1,5 +1,12 @@
/**
* Represents any Channel on Discord
*/
class Channel {
constructor(client, data, guild) {
/**
* The client that instantiated the Channel
* @type {Channel}
*/
this.client = client;
this.typingMap = {};
this.typingTimeouts = [];
@@ -13,9 +20,22 @@ class Channel {
}
setup(data) {
/**
* The unique ID of the channel
* @type {String}
*/
this.id = data.id;
}
/**
* Deletes the channel
* @return {Promise<Channel>}
* @example
* // delete the channel
* channel.delete()
* .then() // success
* .catch(console.log); // log error
*/
delete() {
return this.client.rest.methods.deleteChannel(this);
}