Response Values
Tennu Message events that have a `"channel"` property (including all commands can return values telling Tennu to respond to the message with a certain message. This return value is called the `Response`.
The Response has a type of undefined | string | [string] | {intent, message, query, target} | Promise<Response>.
The return value can also a promise of the previous values.
undefined
You can totally return nothing at the end of a handler. Tennu will not respond in that case.
String
The simplest of the return values, this string is sent to the channel in a privmsg.
Using this, we can create a really simple echobot:
Array of Strings
Just as Client.say can take an array of strings, you can also return an array of strings, and each string will be said to the channel in the order sent.
Response Object
Property | Description |
---|---|
message |
string | [string] | [CtcpTag, CtcpBody]
The message or list of messages to send to the target. When the intent is |
intent |
"say" | "act" | "ctcp" | "ctcpRequest" | "ctcpResponse" | "notice" | "none" | undefined
|
target |
NickName | ChannelName
The nickname or channel to send the message to. |
query |
Boolean
Whether to disregard the target, and send the message to the message's sender. |
Promise
You can return a Promise of any of the previous values, and the system will process your response when the promise resolves.