Skip to content

Commit

Permalink
fix(Guild#createChannel): default to text (#2168)
Browse files Browse the repository at this point in the history
update docs


doc fixes


real fix


stuf
  • Loading branch information
Lewdcario authored and iCrawl committed Dec 12, 2017
1 parent 1c34819 commit 9f0417c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client/rest/RESTMethods.js
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/structures/Guild.js
Expand Up @@ -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<PermissionOverwrites|ChannelCreationOverwrites>} [overwrites] Permission overwrites
* @param {string} [reason] Reason for creating this channel
* @returns {Promise<TextChannel|VoiceChannel>}
* @returns {Promise<CategoryChannel|TextChannel|VoiceChannel>}
* @example
* // Create a new text channel
* guild.createChannel('new-general', 'text')
Expand Down

0 comments on commit 9f0417c

Please sign in to comment.