3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35: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

@ -3,6 +3,7 @@ import { Message, TextChannel } from "eris";
import { UnknownUser, resolveMember, noop, resolveUser } from "../../../utils";
import { saveMessageToStarboard } from "../util/saveMessageToStarboard";
import { updateStarboardMessageStarCount } from "../util/updateStarboardMessageStarCount";
import { allStarboardsLock } from "../../../utils/lockNameHelpers";
export const StarboardReactionAddEvt = starboardEvt({
event: "messageReactionAdd",
@ -36,7 +37,7 @@ export const StarboardReactionAddEvt = starboardEvt({
categoryId: (msg.channel as TextChannel).parentID,
});
const boardLock = await pluginData.locks.acquire(`starboards`);
const boardLock = await pluginData.locks.acquire(allStarboardsLock());
const applicableStarboards = Object.values(config.boards)
.filter(board => board.enabled)