This article covers the following platforms
MSFS 2024
MSFS 2020
ATS
FSX
Prepar3D
Use the Twitch API to check whether Flow is connected to Twitch chat and to send chat messages.
is_connected()
Check whether Flow is connected to Twitch chat.
SignatureTypeScript contract
is_connected(): booleanExampleJavaScript
const isConnected = this.$api.twitch.is_connected();
console.log(isConnected);Returns
booleanWhether Flow is connected to Twitch chat.send_message()
Send a message to the connected Twitch chat.
SignatureTypeScript contract
send_message(message: string, prefix?: string): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message to send. |
prefix | string | No | Optional Twitch IRC prefix. For replies, use @reply-parent-msg-id=<message-id>. |
ExampleJavaScript
this.$api.twitch.send_message("Thanks for watching!");Returns
voidNo direct return value is documented.Related lifecycle functions
twitch_message()handles incoming chat messages.twitch_connection()responds to connection changes.