3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Allow mute and unmute to be upgraded to their force variant (#174)

This commit is contained in:
Nils 2021-04-02 15:53:09 +02:00 committed by GitHub
parent c4a8c3014e
commit 56ade239dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 16 deletions

View file

@ -6,7 +6,7 @@ import { formatReasonWithAttachments } from "../functions/formatReasonWithAttach
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { LogType } from "../../../data/LogType";
import { CaseTypes } from "../../../data/CaseTypes";
import { errorMessage, resolveMember, resolveUser, stripObjectToScalars } from "../../../utils";
import { errorMessage, noop, resolveMember, resolveUser, stripObjectToScalars } from "../../../utils";
import { isBanned } from "../functions/isBanned";
import { waitForReaction } from "knub/dist/helpers";
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
@ -59,15 +59,18 @@ export const MuteCmd = modActionsCmd({
msg.channel,
`User is banned. Use \`${prefix}forcemute\` if you want to mute them anyway.`,
);
return;
} else {
sendErrorMessage(
pluginData,
msg.channel,
`User is not on the server. Use \`${prefix}forcemute\` if you want to mute them anyway.`,
);
}
// Ask the mod if we should upgrade to a forcemute as the user is not on the server
const notOnServerMsg = await msg.channel.createMessage("User not found on the server, forcemute instead?");
const reply = await waitForReaction(pluginData.client, notOnServerMsg, ["✅", "❌"], msg.author.id);
return;
notOnServerMsg.delete().catch(noop);
if (!reply || reply.name === "❌") {
sendErrorMessage(pluginData, msg.channel, "User not on server, mute cancelled by moderator");
return;
}
}
}
// Make sure we're allowed to mute this member