From 9f0417c09d2422412e474b6b9075c94f76a46494 Mon Sep 17 00:00:00 2001 From: Isabella Date: Mon, 11 Dec 2017 23:33:48 -0600 Subject: [PATCH] fix(Guild#createChannel): default to text (#2168) update docs doc fixes real fix stuf --- src/client/rest/RESTMethods.js | 2 +- src/structures/Guild.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/rest/RESTMethods.js b/src/client/rest/RESTMethods.js index 4904f0eb3b60..d3b54d91fe4b 100644 --- a/src/client/rest/RESTMethods.js +++ b/src/client/rest/RESTMethods.js @@ -279,7 +279,7 @@ class RESTMethods { } return this.rest.makeRequest('post', Endpoints.Guild(guild).channels, true, { name: channelName, - type: Constants.ChannelTypes[channelType.toUpperCase()], + type: channelType ? Constants.ChannelTypes[channelType.toUpperCase()] : 'text', permission_overwrites: overwrites, }, undefined, reason).then(data => this.client.actions.ChannelCreate.handle(data).channel); } diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 374680739b46..8418304f25ed 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -884,10 +884,10 @@ class Guild { /** * Creates a new channel in the guild. * @param {string} name The name of the new channel - * @param {string} type The type of the new channel, either `text` or `voice` or `category` + * @param {string} [type='text'] The type of the new channel, either `text` or `voice` or `category` * @param {Array} [overwrites] Permission overwrites * @param {string} [reason] Reason for creating this channel - * @returns {Promise} + * @returns {Promise} * @example * // Create a new text channel * guild.createChannel('new-general', 'text')