ban
suspend fun ban(broadcasterId: String, moderatorId: String, userId: String, reason: String = "", duration: Int? = null)
Bans a user from participating in the specified broadcaster's chat room or puts them in a timeout.
Parameters
broadcasterId
the ID of the broadcaster whose chat room the user is being banned from.
moderatorId
the ID of the broadcaster or a user that has permission to moderate the broadcaster's chat room. This ID must match the user ID in the user access token.
userId
the ID of the user to ban or put in a timeout.
reason
the reason you're banning the user or putting them in a timeout. The text is user defined and is limited to a maximum of 500 characters.
duration
to ban a user indefinitely, don't include this field. To put a user in a timeout, specify the timeout period, in seconds. The minimum timeout is 1 second and the maximum is 1,209,600 seconds (2 weeks).