summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-04-24 09:10:22 +0300
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-19 15:59:58 +1100
commitdb4ed3bb6dbea05ff0592bc8fda94e90398a75ab (patch)
tree393311f0c79c93d0ca6b6de67f85f8d0d3a16e73 /src
parentMake fosscord read config from json if CONFIG_PATH is set (diff)
downloadserver-db4ed3bb6dbea05ff0592bc8fda94e90398a75ab.tar.xz
make it configurable by guild feature flag
Diffstat (limited to 'src')
-rw-r--r--src/util/entities/Channel.ts10
1 files 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(),
 		]);