function createChatMessage
createChatMessage(
userId: string,
body: string,
replyToId?: string
): ChatMessage

Stores a message from userId on a chat_send, and claims the pasted images it links to. A replyToId naming no message is dropped, and the message is posted as no reply. The message mentionsEveryone when it says @everyone and userId may. The caller broadcasts the result, and notifies everyone when it is flagged.

Parameters

userId: string
body: string
optional
replyToId: string

Return Type

Throws

APIException

400 when the body is blank or longer than VALIDATION.CHAT_MESSAGE_MAX.

Usage

import { createChatMessage } from "api/services/chat-service.ts";