Merge pull request #1054 from CyberL1/master

fix: don't create new vanity url when there's no ALIASABLE_NAMES flag
This commit is contained in:
Madeline 2023-05-13 19:12:18 +10:00 committed by GitHub
commit 60394d8c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,17 @@ router.patch(
where: { guild_id, type: ChannelType.GUILD_TEXT }, 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({ await Invite.create({
vanity_url: true, vanity_url: true,
code: code, code: code,