startCommercial

suspend fun startCommercial(broadcasterId: String, duration: Int): Commercial

Twitch API: Start Commercial

Starts a commercial on the specified channel. Only partners and affiliates may run commercials and they must be streaming live at the time.

Return

the commercial status including the actual length served, a message, and the retry cooldown.

Parameters

broadcasterId

the ID of the partner or affiliate broadcaster that wants to run the commercial. This ID must match the user ID found in the OAuth token.

duration

the length of the commercial to run, in seconds. Twitch tries to serve a commercial that's the requested length, but it may be shorter or longer. The maximum length you should request is 180 seconds.