|
@@ -79,12 +79,19 @@ export class ViolationPlugin {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- await memberResolve.result.roles.remove(muteRole);
|
|
|
+ const member = memberResolve.result;
|
|
|
+ const unmuteResult = await tryDo(member.roles.remove(muteRole));
|
|
|
+ if (!unmuteResult.ok) {
|
|
|
+ logger.error("mute: failed to unmute user %s#%s (%s). Maybe he's already unmuted?",
|
|
|
+ member.user?.username,
|
|
|
+ member.user?.discriminator,
|
|
|
+ member.user?.id,);
|
|
|
+ }
|
|
|
const mute = violation as Mute;
|
|
|
if (mute.previousRoles) {
|
|
|
- const result = await tryDo(memberResolve.result.roles.set(mute.previousRoles));
|
|
|
+ const result = await tryDo(member.roles.set(mute.previousRoles));
|
|
|
if (!result.ok) {
|
|
|
- logger.warn("mute: couldn't readd all roles for user %s (tried to restore role ids: %s)", memberResolve.result.id, mute.previousRoles.join(", "));
|
|
|
+ logger.warn("mute: couldn't readd all roles for user %s (tried to restore role ids: %s)", member.id, mute.previousRoles.join(", "));
|
|
|
}
|
|
|
}
|
|
|
},
|