From cdb74a75f2e0853a86595ab659447f913867f675 Mon Sep 17 00:00:00 2001 From: LewisHogan Date: Wed, 24 Aug 2016 23:38:07 +0100 Subject: [PATCH] Indev rewrite - Changed GuildChannel type (#536) * Altered GuildChannel.type to return a string containing either "text", "voice" or the id of the channel type. * Fixed typo * Altered code to pass ESLint test (Functionality Unchanged). * Third times the charm. --- src/structures/GuildChannel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index b8f6b196a..96ff2be4e 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -33,9 +33,11 @@ class GuildChannel extends Channel { super.setup(data); /** * The type of the Guild Channel - * @type {Number} + * @type {String} */ - this.type = data.type; + if (data.type === 0) this.type = 'text'; + else if (data.type === 2) this.type = 'voice'; + else this.type = data.type.toString(); /** * The topic of the Guild Channel, if there is one. * @type {?String}