MCPcopy
hub / github.com/codebymitch/TitanBot / logEvent

Function logEvent

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

Source from the content-addressed store, hash-verified

70}
71
72export async function logEvent({ client, guild, guildId, event }) {
73 try {
74 if (!guild && guildId) {
75 guild = client.guilds.cache.get(guildId) || await client.guilds.fetch(guildId).catch(() => null);
76 }
77 if (!guild) {
78 logger.warn('logEvent invoked without valid guild or guildId');
79 return;
80 }
81
82 const eventType = ACTION_TO_EVENT_TYPE[event.action] || EVENT_TYPES.MODERATION_CONFIG;
83 const data = buildModerationLogData(event);
84
85 await logAuditEvent({
86 client,
87 guildId: guild.id,
88 eventType,
89 data,
90 });
91
92 logger.info(`Moderation action logged: ${event.action} by ${event.executor} on ${event.target} in guild ${guild.id}`);
93 } catch (error) {
94 logger.error('Error logging moderation event:', error);
95 }
96}
97
98export async function generateCaseId(client, guildId) {
99 try {

Callers 15

logModerationActionFunction · 0.90
handleApplicationModalFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
handleSetupFunction · 0.90
handleDeletePanelFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90

Calls 2

buildModerationLogDataFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected