Skip to content

Commit

Permalink
feat(GuildChannelStore): support for create with rateLimitPerUser (di…
Browse files Browse the repository at this point in the history
…scordjs#2878)

* change GuildChannelStore#create

* document rateLimitPerUser

* update typings
  • Loading branch information
xDimGG authored and SpaceEEC committed Oct 10, 2018
1 parent 8feb874 commit 8ec3b51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stores/GuildChannelStore.js
Expand Up @@ -33,6 +33,7 @@ class GuildChannelStore extends DataStore {
* @param {ChannelResolvable} [options.parent] Parent of the new channel
* @param {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} [options.overwrites]
* Permission overwrites of the new channel
* @param {number} [options.rateLimitPerUser] The ratelimit per user for the channel
* @param {string} [options.reason] Reason for creating the channel
* @returns {Promise<GuildChannel>}
* @example
Expand All @@ -52,7 +53,7 @@ class GuildChannelStore extends DataStore {
* ],
* })
*/
async create(name, { type, topic, nsfw, bitrate, userLimit, parent, overwrites, reason } = {}) {
async create(name, { type, topic, nsfw, bitrate, userLimit, parent, overwrites, rateLimitPerUser, reason } = {}) {
if (parent) parent = this.client.channels.resolveID(parent);

const data = await this.client.api.guilds(this.guild.id).channels.post({
Expand All @@ -65,6 +66,7 @@ class GuildChannelStore extends DataStore {
user_limit: userLimit,
parent_id: parent,
permission_overwrites: overwrites && overwrites.map(o => PermissionOverwrites.resolve(o, this.guild)),
rate_limit_per_user: rateLimitPerUser,
},
reason,
});
Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Expand Up @@ -1751,6 +1751,7 @@ declare module 'discord.js' {
userLimit?: number;
parent?: ChannelResolvable;
overwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
rateLimitPerUser?: number;
reason?: string
};

Expand Down

0 comments on commit 8ec3b51

Please sign in to comment.