From c9c2d6697119fcbe9b0f4e8285852f62a4dbccda Mon Sep 17 00:00:00 2001 From: Faith Date: Fri, 20 Apr 2018 13:11:46 -0400 Subject: [PATCH] feat(GuildChannelStore): add topic to create options (#2488) 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. --- src/stores/GuildChannelStore.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stores/GuildChannelStore.js b/src/stores/GuildChannelStore.js index f629c258b..03efe2315 100644 --- a/src/stores/GuildChannelStore.js +++ b/src/stores/GuildChannelStore.js @@ -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) @@ -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,