mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
feat(GuildChannelStore): support for create with rateLimitPerUser (#2878)
* change GuildChannelStore#create * document rateLimitPerUser * update typings
This commit is contained in:
parent
8feb874586
commit
8ec3b5134d
2 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
@ -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({
|
||||
|
|
@ -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,
|
||||
});
|
||||
|
|
|
|||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
|
|
@ -1751,6 +1751,7 @@ declare module 'discord.js' {
|
|||
userLimit?: number;
|
||||
parent?: ChannelResolvable;
|
||||
overwrites?: OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
|
||||
rateLimitPerUser?: number;
|
||||
reason?: string
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue