From 487d32d303c340b1609b0fe6b829a5f4fe001ef0 Mon Sep 17 00:00:00 2001 From: Skick Date: Sun, 17 Oct 2021 21:18:33 +0700 Subject: [PATCH] feat(GuildChannelManager): add 'rtcRegion' option to 'create' method (#6849) Co-authored-by: Vlad Frangu --- src/managers/GuildChannelManager.js | 15 ++++++++++++++- src/structures/CategoryChannel.js | 1 + typings/index.d.ts | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/managers/GuildChannelManager.js b/src/managers/GuildChannelManager.js index 8707cdc96483..55158c2a88db 100644 --- a/src/managers/GuildChannelManager.js +++ b/src/managers/GuildChannelManager.js @@ -121,7 +121,19 @@ class GuildChannelManager extends CachedManager { */ async create( name, - { type, topic, nsfw, bitrate, userLimit, parent, permissionOverwrites, position, rateLimitPerUser, reason } = {}, + { + type, + topic, + nsfw, + bitrate, + userLimit, + parent, + permissionOverwrites, + position, + rateLimitPerUser, + rtcRegion, + reason, + } = {}, ) { parent &&= this.client.channels.resolveId(parent); permissionOverwrites &&= permissionOverwrites.map(o => PermissionOverwrites.resolve(o, this.guild)); @@ -138,6 +150,7 @@ class GuildChannelManager extends CachedManager { position, permission_overwrites: permissionOverwrites, rate_limit_per_user: rateLimitPerUser, + rtc_region: rtcRegion, }, reason, }); diff --git a/src/structures/CategoryChannel.js b/src/structures/CategoryChannel.js index d23c6e4df997..ce5b5f61cd89 100644 --- a/src/structures/CategoryChannel.js +++ b/src/structures/CategoryChannel.js @@ -39,6 +39,7 @@ class CategoryChannel extends GuildChannel { * Permission overwrites of the new channel * @property {number} [position] Position of the new channel * @property {number} [rateLimitPerUser] The rate limit per user (slowmode) for the new channel in seconds + * @property {string} [rtcRegion] The specific region of the new channel. * @property {string} [reason] Reason for creating the new channel */ diff --git a/typings/index.d.ts b/typings/index.d.ts index e53b001a90ec..4753f6230085 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3419,6 +3419,7 @@ export interface CategoryCreateChannelOptions { userLimit?: number; rateLimitPerUser?: number; position?: number; + rtcRegion?: string; reason?: string; }