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

Function logModerationAction

src/utils/moderation.js:170–198  ·  view source on GitHub ↗
({ client, guild, event })

Source from the content-addressed store, hash-verified

168}
169
170export async function logModerationAction({ client, guild, event }) {
171 const caseId = await generateCaseId(client, guild.id);
172
173 await storeModerationCase({
174 guildId: guild.id,
175 caseId,
176 caseData: {
177 action: event.action,
178 target: event.target,
179 executor: event.executor,
180 reason: event.reason,
181 duration: event.duration,
182 metadata: event.metadata,
183 targetUserId: event.metadata?.userId,
184 moderatorId: event.metadata?.moderatorId
185 }
186 });
187
188 await logEvent({
189 client,
190 guild,
191 event: {
192 ...event,
193 caseId
194 }
195 });
196
197 return caseId;
198}

Callers 8

executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
banUserMethod · 0.90
kickUserMethod · 0.90
timeoutUserMethod · 0.90
removeTimeoutUserMethod · 0.90
unbanUserMethod · 0.90

Calls 3

logEventFunction · 0.90
storeModerationCaseFunction · 0.85
generateCaseIdFunction · 0.70

Tested by

no test coverage detected