Skip to content

Commit

Permalink
feat(GuildChannelStore): add topic to create options (#2488)
Browse files Browse the repository at this point in the history
The API provides the ability to send the topic, or description, of the channel within the creation post. Discord.js will now send it if its provided.
  • Loading branch information
UnseenFaith authored and SpaceEEC committed Apr 20, 2018
1 parent 8d065fa commit c9c2d66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stores/GuildChannelStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class GuildChannelStore extends DataStore {
* @param {string} name The name of the new channel
* @param {Object} [options] Options
* @param {string} [options.type='text'] The type of the new channel, either `text`, `voice`, or `category`
* @param {string} [options.topic] The topic for the new channel
* @param {boolean} [options.nsfw] Whether the new channel is nsfw
* @param {number} [options.bitrate] Bitrate of the new channel in bits (only voice)
* @param {number} [options.userLimit] Maximum amount of users allowed in the new channel (only voice)
Expand All @@ -58,11 +59,12 @@ class GuildChannelStore extends DataStore {
* ],
* })
*/
create(name, { type, nsfw, bitrate, userLimit, parent, overwrites, reason } = {}) {
create(name, { type, topic, nsfw, bitrate, userLimit, parent, overwrites, reason } = {}) {
if (parent) parent = this.client.channels.resolveID(parent);
return this.client.api.guilds(this.guild.id).channels.post({
data: {
name,
topic,
type: type ? ChannelTypes[type.toUpperCase()] : 'text',
nsfw,
bitrate,
Expand Down

0 comments on commit c9c2d66

Please sign in to comment.