1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00

Merge branch 'fix/nicknames' into slowcord

This commit is contained in:
Madeline 2022-07-03 01:47:57 +10:00
commit 63f466aa6a
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -35,7 +35,10 @@ router.patch("/", route({ body: "MemberChangeSchema" }), async (req: Request, re
member.roles = body.roles.map((x) => new Role({ id: x })); // foreign key constraint will fail if role doesn't exist
}
if (body.nick) member.nick = body.nick;
if ('nick' in body) {
permission.hasThrow("CHANGE_NICKNAME");
Member.changeNickname(member.id, member.guild.id, body.nick!);
}
await member.save();