diff options
author | CyberL1 <mateusz.hf18@gmail.com> | 2023-05-10 18:57:04 +0200 |
---|---|---|
committer | CyberL1 <mateusz.hf18@gmail.com> | 2023-05-10 18:57:04 +0200 |
commit | 5b3ef06c6b0dd44fcf9f4ffd0a71accc17a68707 (patch) | |
tree | 1b39c7e8589f243e58cb39f23e0ff9d85212c779 /src | |
parent | Merge pull request #1052 from spacebarchat/feat/auto-create-bot-users (diff) | |
download | server-5b3ef06c6b0dd44fcf9f4ffd0a71accc17a68707.tar.xz |
fix: don't create new vanity url when there's no ALIASABLE_NAMES flag
Diffstat (limited to 'src')
-rw-r--r-- | src/api/routes/guilds/#guild_id/vanity-url.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/routes/guilds/#guild_id/vanity-url.ts b/src/api/routes/guilds/#guild_id/vanity-url.ts index d271c976..941f463b 100644 --- a/src/api/routes/guilds/#guild_id/vanity-url.ts +++ b/src/api/routes/guilds/#guild_id/vanity-url.ts @@ -107,6 +107,12 @@ router.patch( where: { guild_id, type: ChannelType.GUILD_TEXT }, }); + if (!guild.features.includes("ALIASABLE_NAMES")) { + await Invite.update({ guild_id }, { + code: code + }); + } + await Invite.create({ vanity_url: true, code: code, |