{ "version":"2.2.0","name":"Send IRC Message","description":"Send message to IRC channel with slowmode rate limiting","trigger":{"type":"http","method":"POST","path":"/irc/channels/:channelId/messages"},"nodes":[{"id":"validate_context","type":"operation","op":"validate","input":"{{ $context.user.id }}","validator":"required"},{"id":"apply_slowmode","type":"operation","op":"rate_limit","key":"{{ 'irc:' + $context.user.id + ':' + $json.channelId }}","limit":1,"window":2000},{"id":"validate_input","type":"operation","op":"validate","input":"{{ $json }}","rules":{"message":"required|string|minLength:1|maxLength:500"}},{"id":"create_message","type":"operation","op":"database_create","entity":"IRCMessage","data":{"channelId":"{{ $json.channelId }}","userId":"{{ $context.user.id }}","tenantId":"{{ $context.tenantId }}","message":"{{ $json.message }}","createdAt":"{{ new Date().toISOString() }}"}},{"id":"emit_message","type":"action","action":"emit_event","event":"message_sent","channel":"{{ 'irc:' + $json.channelId }}","data":{"messageId":"{{ $steps.create_message.output.id }}","userId":"{{ $context.user.id }}","message":"{{ $json.message }}"}}] }