mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 18:15:41 +00:00
allow setting communication_disabled_until
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -128,6 +128,11 @@ router.patch(
|
||||
member.roles = body.roles.map((x) => Role.create({ id: x }));
|
||||
}
|
||||
|
||||
if ("communication_disabled_until" in body) {
|
||||
permission.hasThrow("MODERATE_MEMBERS");
|
||||
member.communication_disabled_until = body.communication_disabled_until == null ? null : new Date(body.communication_disabled_until) ;
|
||||
}
|
||||
|
||||
await member.save();
|
||||
|
||||
member.roles = member.roles.filter((x) => x.id !== guild_id);
|
||||
|
||||
@@ -21,4 +21,5 @@ export interface MemberChangeSchema {
|
||||
nick?: string;
|
||||
avatar?: string | null;
|
||||
bio?: string;
|
||||
communication_disabled_until?: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user