From abb93c9eb99ee1cf1580b3d09e46679186e8b6b7 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Wed, 3 Jan 2018 18:01:39 -0600 Subject: [PATCH] fix location of toString for channels (#2202) --- src/structures/Channel.js | 11 +++++++++++ src/structures/GuildChannel.js | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/structures/Channel.js b/src/structures/Channel.js index 04867b118..833d9ef12 100644 --- a/src/structures/Channel.js +++ b/src/structures/Channel.js @@ -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} diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 0862f1455..25c26274b 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -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;