1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 01:31:34 +02:00

make it configurable by guild feature flag

This commit is contained in:
Erkin Alp Güney 2022-04-24 09:10:22 +03:00 committed by Madeline
parent 8a2d1547f5
commit 08e9f80e9a
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -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(),
]);