fix location of toString for channels (#2202)

This commit is contained in:
Gus Caplan
2018-01-03 18:01:39 -06:00
committed by Crawl
parent 954a1c8d1a
commit abb93c9eb9
2 changed files with 11 additions and 11 deletions

View File

@@ -52,6 +52,17 @@ class Channel extends Base {
return new Date(this.createdTimestamp);
}
/**
* When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
* @returns {string}
* @example
* // Logs: Hello from <#123456789012345678>!
* console.log(`Hello from ${channel}!`);
*/
toString() {
return `<#${this.id}>`;
}
/**
* Deletes this channel.
* @returns {Promise<Channel>}

View File

@@ -489,17 +489,6 @@ class GuildChannel extends Channel {
return MessageNotificationTypes[3];
}
}
/**
* When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
* @returns {string}
* @example
* // Logs: Hello from <#123456789012345678>!
* console.log(`Hello from ${channel}!`);
*/
toString() {
return `<#${this.id}>`;
}
}
module.exports = GuildChannel;