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:
parent
fcbb25b7ff
commit
c5d68650a3
18 changed files with 70 additions and 28 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue