({ client, guild, event })
| 168 | } |
| 169 | |
| 170 | export 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 | } |
no test coverage detected