mutes: fix error when member to unmute cannot be found
This commit is contained in:
parent
69feccbcab
commit
69db410808
1 changed files with 1 additions and 1 deletions
|
@ -1044,7 +1044,7 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
if (!user) return this.sendErrorMessage(msg.channel, `User not found`);
|
if (!user) return this.sendErrorMessage(msg.channel, `User not found`);
|
||||||
const memberToUnmute = await this.getMember(user.id);
|
const memberToUnmute = await this.getMember(user.id);
|
||||||
const mutesPlugin = this.getPlugin<MutesPlugin>("mutes");
|
const mutesPlugin = this.getPlugin<MutesPlugin>("mutes");
|
||||||
const hasMuteRole = mutesPlugin.hasMutedRole(memberToUnmute);
|
const hasMuteRole = memberToUnmute && mutesPlugin.hasMutedRole(memberToUnmute);
|
||||||
|
|
||||||
// Check if they're muted in the first place
|
// Check if they're muted in the first place
|
||||||
if (!(await this.mutes.isMuted(args.user)) && !hasMuteRole) {
|
if (!(await this.mutes.isMuted(args.user)) && !hasMuteRole) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue