summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-05-13 19:12:18 +1000
committerGitHub <noreply@github.com>2023-05-13 19:12:18 +1000
commit60394d8c43904ff17935d6edbbfb09ecd479570a (patch)
tree4959808c65ee15fc6bbe94a75fc5e1bf6fda4c2b
parentPrevent /invites/:code for bots (diff)
parentfix: add return and run prettier (diff)
downloadserver-60394d8c43904ff17935d6edbbfb09ecd479570a.tar.xz
Merge pull request #1054 from CyberL1/master
fix: don't create new vanity url when there's no ALIASABLE_NAMES flag
-rw-r--r--src/api/routes/guilds/#guild_id/vanity-url.ts11
1 files changed, 11 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..a64ae2c9 100644 --- a/src/api/routes/guilds/#guild_id/vanity-url.ts +++ b/src/api/routes/guilds/#guild_id/vanity-url.ts
@@ -107,6 +107,17 @@ router.patch( where: { guild_id, type: ChannelType.GUILD_TEXT }, }); + if (!guild.features.includes("ALIASABLE_NAMES")) { + await Invite.update( + { guild_id }, + { + code: code, + }, + ); + + return res.json({ code }); + } + await Invite.create({ vanity_url: true, code: code,