Skip to content

Commit

Permalink
unmute fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saiteja-madha committed Sep 24, 2021
1 parent ee49d33 commit 097fcee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/schemas/modlog-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ module.exports = {
member_id: targetId,
type: "MUTE",
"data.current": true,
}),
}).lean({ defaults: true }),

removeMutes: async (guildId, targetId) =>
Model.updateOne(
Model.updateMany(
{
guild_id: guildId,
member_id: targetId,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/modUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ async function unmuteTarget(issuer, target, reason) {
let mutedRole = getRoleByName(issuer.guild, "muted");
try {
await removeMutes(issuer.guild.id, target.id);
if (target.roles.cache.has(mutedRole)) await target.roles.remove(mutedRole);
if (hasMutedRole(target)) await target.roles.remove(mutedRole);
await logModeration(issuer, target, reason, "Unmute");
return true;
} catch (ex) {
Expand Down

0 comments on commit 097fcee

Please sign in to comment.