fix(api): correct guild permission and mfa checks (#2499)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-06 15:28:01 +02:00
1 parent f392636857
commit 908e1b8bd4
12 files changed
+303 -86

No files matched your search

@@ -914,11 +914,16 @@ export class GuildMemberOperationsService {
if (userId !== targetId) {
await checkTargetMember(targetId);
}
if (data.mute !== undefined || data.deaf !== undefined) {
if (data.mute !== undefined) {
if (!(await hasPermission(Permissions.MUTE_MEMBERS))) {
throw new MissingPermissionsError();
}
}
if (data.deaf !== undefined) {
if (!(await hasPermission(Permissions.DEAFEN_MEMBERS))) {
throw new MissingPermissionsError();
}
}
if (data.channel_id !== undefined) {
if (!(await hasPermission(Permissions.MOVE_MEMBERS))) {
throw new MissingPermissionsError();