3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-13 21:35:02 +00:00

Fixed mute command not updating case when no reason

This commit is contained in:
Lily Bergonzat 2024-02-20 14:23:43 +01:00
parent 0fee24e973
commit 174e5cc23b

View file

@ -246,10 +246,12 @@ export async function muteUser(
if (theCase) {
// Update old case
const noteDetails = [`Mute updated to ${muteTime ? timeUntilUnmuteStr : "indefinite"}`];
const reasons = reason ? [reason] : [];
const reasons = reason ? [reason] : [""]; // Empty string so that there is a case update even without reason
if (muteOptions.caseArgs?.extraNotes) {
reasons.push(...muteOptions.caseArgs.extraNotes);
}
for (const noteReason of reasons) {
await casesPlugin.createCaseNote({
caseId: existingMute!.case_id,