{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://sneak.berlin/go/neoirc/schema/message.json", "title": "IRC Message Envelope", "description": "Every message in the HTTP API is one JSON object with these fields. Only 'command' is always present.", "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "The message's UUID, which the server assigns. Present on every message the server queues for a client." }, "command": { "type": "string", "description": "An IRC command name, such as PRIVMSG, or the name of a numeric reply, such as RPL_WELCOME. The server reads a client's command in any case and sends it in upper case.", "examples": ["PRIVMSG", "JOIN", "RPL_WELCOME", "ERR_NICKNAMEINUSE"] }, "code": { "type": "integer", "minimum": 1, "maximum": 999, "description": "The number of a numeric reply, such as 1 for RPL_WELCOME. Absent on other messages." }, "from": { "type": "string", "description": "The sender's nick, or the server name on a numeric reply or a PONG. The server sets it and ignores it from a client." }, "to": { "type": "string", "description": "The target: a channel name, such as #general, or a nick. A WALLOPS has * here." }, "params": { "type": "array", "items": { "type": "string" }, "description": "The message's other parameters, in order. KICK events and many numeric replies have it. The server ignores it from a client." }, "body": { "type": "array", "items": { "type": "string" }, "description": "An array of strings, never a bare string. In a PRIVMSG or NOTICE, each string is one line of text." }, "ts": { "type": "string", "format": "date-time", "description": "The time the server stored the message, as an RFC 3339 time in UTC." }, "meta": { "type": "object", "description": "An object of extra data. Every message the server queues for a client has meta, which is {} when there is none. The server keeps a client's meta only on a PRIVMSG or NOTICE, and relays it unchanged.", "properties": { "hashcash": { "type": "string", "description": "A hashcash stamp. A PRIVMSG to a channel with mode +H needs one." } }, "additionalProperties": true } }, "required": ["command"] }