This commit is contained in:
Flam3rboy
2021-08-13 13:07:25 +02:00
8 changed files with 23 additions and 7 deletions
@@ -17,8 +17,8 @@ router.patch("/", check(MemberNickChangeSchema), async (req: Request, res: Respo
const perms = await getPermission(req.user_id, guild_id);
perms.hasThrow(permissionString);
await changeNickname(member_id, guild_id, req.body.nickname);
res.status(204);
await changeNickname(member_id, guild_id, req.body.nick);
res.status(200).send();
});
export default router;
+14
View File
@@ -0,0 +1,14 @@
// https://discord.com/developers/docs/resources/emoji
export const EmojiCreateSchema = {
name: String, //name of the emoji
image: String, // image data the 128x128 emoji image uri
roles: Array //roles allowed to use this emoji
};
export interface EmojiCreateSchema {
name: string; // name of the emoji
image: string; // image data the 128x128 emoji image uri
roles: []; //roles allowed to use this emoji
}
+1
View File
@@ -197,6 +197,7 @@ export async function removeRole(user_id: string, guild_id: string, role_id: str
export async function changeNickname(user_id: string, guild_id: string, nickname: string) {
const user = await getPublicUser(user_id);
var memberObj = await MemberModel.findOneAndUpdate(
{
id: user_id,