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

Enforce unified lock names by using functions to generate lock keys (#165)

This commit is contained in:
Nils 2021-04-02 15:43:13 +02:00 committed by GitHub
parent fcbb25b7ff
commit c5d68650a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 70 additions and 28 deletions

View file

@ -17,8 +17,8 @@ import { CasesPlugin } from "../../Cases/CasesPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { Case } from "../../../data/entities/Case";
import { sendErrorMessage } from "src/pluginUtils";
import { LogsPlugin } from "src/plugins/Logs/LogsPlugin";
import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin";
import { muteLock } from "../../../utils/lockNameHelpers";
export async function muteUser(
pluginData: GuildPluginData<MutesPluginType>,
@ -29,7 +29,7 @@ export async function muteUser(
removeRolesOnMuteOverride: boolean | string[] | null = null,
restoreRolesOnMuteOverride: boolean | string[] | null = null,
) {
const lock = await pluginData.locks.acquire(`mute-${userId}`);
const lock = await pluginData.locks.acquire(muteLock({ id: userId }));
const muteRole = pluginData.config.get().mute_role;
if (!muteRole) {