summary refs log tree commit diff
path: root/src/api/routes/channels
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-17 09:58:25 +0100
committerRory& <root@rory.gay>2025-12-17 11:04:16 +0100
commit11973397c812da59c2d544047bbb2d2d9ae583a7 (patch)
tree3e2064c4f6ff306241910dbfb877c03f46f935aa /src/api/routes/channels
parentFix extension cleanup stuff from Mathium05 (diff)
downloadserver-ts-github/dev/emma-wip.tar.xz
Diffstat (limited to 'src/api/routes/channels')
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts

index 0a84e6b0..edca59df 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -19,7 +19,8 @@ import { handleMessage, postHandleMessage, route } from "@spacebar/api"; import { Attachment, - AutomodExecutor, AutomodInvocation, + AutomodExecutor, + AutomodInvocation, AutomodRule, AutomodTriggerTypes, Channel, @@ -443,13 +444,15 @@ router.post( // @ts-ignore message.member.roles = message.member.roles.filter((x) => x.id != x.guild_id).map((x) => x.id); - const automodResult = await AutomodExecutor.executeInvocation(new AutomodInvocation({ - eventType: AutomodRuleEventType.MESSAGE_SEND, - guildId: message.guild_id, - payload: message - })); + const automodResult = await AutomodExecutor.executeInvocation( + new AutomodInvocation({ + eventType: AutomodRuleEventType.MESSAGE_SEND, + guildId: message.guild_id, + payload: message, + }), + ); - if(automodResult.blocked) { + if (automodResult.blocked) { throw new HTTPError("Unhandled error sending message", 403); } }