From 08e9f80e9aa867905865d391bfef5a5a8a8ded56 Mon Sep 17 00:00:00 2001 From: Erkin Alp Güney Date: Sun, 24 Apr 2022 09:10:22 +0300 Subject: make it configurable by guild feature flag --- src/util/entities/Channel.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts index 14f36857..2aba739a 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts @@ -203,7 +203,7 @@ export class Channel extends BaseClass { ); // Categories skip these checks on discord.com - if (channel.type !== ChannelType.GUILD_CATEGORY) { + if (channel.type !== ChannelType.GUILD_CATEGORY || guild.features.includes("IRC_LIKE_CATEGORY_NAMES")) { if (channel.name.includes(" ")) throw new HTTPError( "Channel name cannot include invalid characters", @@ -280,10 +280,10 @@ export class Channel extends BaseClass { Channel.create(channel).save(), !opts?.skipEventEmit ? emitEvent({ - event: "CHANNEL_CREATE", - data: channel, - guild_id: channel.guild_id, - } as ChannelCreateEvent) + event: "CHANNEL_CREATE", + data: channel, + guild_id: channel.guild_id, + } as ChannelCreateEvent) : Promise.resolve(), ]); -- cgit 1.4.1