diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-05-13 19:12:18 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 19:12:18 +1000 |
commit | 60394d8c43904ff17935d6edbbfb09ecd479570a (patch) | |
tree | 4959808c65ee15fc6bbe94a75fc5e1bf6fda4c2b | |
parent | Prevent /invites/:code for bots (diff) | |
parent | fix: add return and run prettier (diff) | |
download | server-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.ts | 11 |
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, |