MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / generateCaseId

Function generateCaseId

src/utils/moderation.js:98–109  ·  view source on GitHub ↗
(client, guildId)

Source from the content-addressed store, hash-verified

96}
97
98export async function generateCaseId(client, guildId) {
99 try {
100 const caseKey = `moderation_cases_${guildId}`;
101 const currentCase = await getFromDb(caseKey, 0);
102 const nextCase = currentCase + 1;
103 await setInDb(caseKey, nextCase);
104 return nextCase;
105 } catch (error) {
106 logger.error("Error generating case ID:", error);
107return Date.now();
108 }
109}
110
111export async function storeModerationCase({ guildId, caseId, caseData }) {
112 try {

Callers 1

logModerationActionFunction · 0.70

Calls 2

getFromDbFunction · 0.90
setInDbFunction · 0.90

Tested by

no test coverage detected