summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-10-19 08:24:28 +0200
committerRory& <root@rory.gay>2025-10-19 08:24:28 +0200
commit416384c8fa981bf17dcf0abfe44d4b9810ca2656 (patch)
treeb513f63e4a53acedb9b86708b0cb05441268fe09 /src/api
parentfix (diff)
downloadserver-ts-416384c8fa981bf17dcf0abfe44d4b9810ca2656.tar.xz
Helper to create valid messages
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts

index 2b1ce592..6c9aa440 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -457,13 +457,15 @@ router.post( for (const action of alertActions) { const alertChannel = await Channel.findOne({ where: { id: action.metadata.channel_id } }); if (!alertChannel) continue; - const msg = Message.create({ + const msg = await Message.createWithDefaults({ channel_id: alertChannel.id, content: `Automod Alert: Message ${message.id} by <@${message.author_id}> in <#${channel.id}> triggered automod rule "${rule.name}".\nMatched terms: ${matches .map((x) => `\`${x![0]}\``) .join(", ")}`, author: message.author, guild_id: message.guild_id, + member_id: message.member_id, + author_id: message.author_id }); await Promise.all([ Message.insert(message),