mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(GuildChannelStore): support for create with rateLimitPerUser (#2878)
* change GuildChannelStore#create * document rateLimitPerUser * update typings
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user