Skip to main content

Chat Messages

Use async.messages.send(...) when engine v2 code should send chat messages without waiting for a backend send result. Use messages.send(...) only when the script needs the returned message object.

Engine v2 only

messages.send(...) and async.messages.send(...) are only available in engine v2. Engine v1 usually sends one rendered response and does not have these helpers.

Send async message

Queues one Kick chat message without waiting for the backend send result.

Send one chat lineAdvanced Script
async.messages.send("Hello chat!");
Send conditional messagesAdvanced Script
const roll = random.int(1, 100);

async.messages.send(`${sender.username} rolled ${roll}.`);

if (roll === 100) {
async.messages.send("Perfect roll!");
}

API reference

async.messages.send

async.messages.send(content, options?)
Input
content
stringnumberbooleanobject

Message content. Values are converted to text before sending.

optionsoptional
object

Optional send settings.

replyToMessageIdoptional
string

Kick message ID that should receive the reply.

Output
void

The message is queued as a side effect.

Reply async message

Queues a reply to the triggering command message without waiting for the backend send result.

Reply to command messageAdvanced Script
async.messages.reply("This is a reply.");
Reply to explicit message IDAdvanced Script
async.messages.reply("This replies to another message.", {
replyToMessageId: "other-message-id",
});
Send with reply targetAdvanced Script
async.messages.send("This is a manual reply.", {
replyToMessageId: message.id,
});

async.messages.send(...) and messages.send(...) do not use the command's asResponse reply target automatically. Use async.messages.reply(...) or messages.reply(...) to reply to the triggering command message, or pass replyToMessageId explicitly. asResponse only applies to the rendered command response.

Reply helpers need a command message context unless you pass replyToMessageId. Custom messages expose their triggering Kick message as kickMessage when one exists. Periodic messages, alerts, stream titles, and test snippets without event data do not have a triggering chat message ID.

API reference

async.messages.reply

async.messages.reply(content, options?)
Input
content
stringnumberbooleanobject

Reply content. Values are converted to text before sending.

optionsoptional
object

Optional reply target override.

replyToMessageIdoptional
string

Kick message ID that should receive the reply.

Output
void

The reply is queued as a side effect.

Send sync message

Sends one Kick chat message and returns the sent message object when available.

Use this synchronous helper when later code needs the returned message object.

Use sent message IDAdvanced Script
const sent = messages.send("First message");

messages.send("Reply to first message", {
replyToMessageId: sent.id,
});

When replyToMessageId is set, the returned object includes it too. In local CLI/test execution without a backend, messages.send(...) uses the same object shape but cannot include a real Kick ID.

API reference

messages.send

messages.send(content, options?)
Input
content
stringnumberbooleanobject

Message content. Values are converted to text before sending.

optionsoptional
object

Optional send settings.

replyToMessageIdoptional
string

Kick message ID that should receive the reply.

Output
object

The sent message shape. Live backend execution includes the Kick message id when available.

idoptional
string

Kick message ID returned by the backend when available.

content
string

Trimmed chat message content.

replyToMessageIdoptional
string

Reply target message ID when the message was sent as a reply.

Example output
{
"id": "msg_456",
"content": "First message",
"replyToMessageId": "msg_123"
}

Reply sync message

Replies to the triggering command message, or to an explicit replyToMessageId.

Use this synchronous helper when later code needs the returned reply message object.

Use reply resultAdvanced Script
const reply = messages.reply("This is a tracked reply.");
log(reply.id ?? "No live Kick message ID in test runs.");

API reference

messages.reply

messages.reply(content, options?)
Input
content
stringnumberbooleanobject

Reply content. Values are converted to text before sending.

optionsoptional
object

Optional reply target override.

replyToMessageIdoptional
string

Kick message ID that should receive the reply.

Output
object

The sent reply message shape.

idoptional
string

Kick message ID returned by the backend when available.

content
string

Trimmed reply content.

replyToMessageIdoptional
string

Reply target message ID.

Example output
{
"id": "msg_789",
"content": "Thanks!",
"replyToMessageId": "msg_123"
}

Limits

Kicklet applies send limits before posting messages to Kick:

LimitBehavior
Empty messagesIgnored after trimming whitespace.
Message countAt most 5 messages.send(...) messages are sent per render.
Message lengthEach sent message is trimmed to 500 characters.
Rate limitOutbound script messages are rate-limited per account.
Test rendersTest runs show the messages that would be sent.

The rendered command response is handled separately from the messages.send(...) message list.

In Advanced Script code, messages.send(...) and messages.reply(...) are synchronous and wait for the backend send result. Use async.messages.send(...) or async.messages.reply(...) when the send should be queued fire-and-forget instead.