Mute a list of channel users
When a user is muted, they cannot send messages in a channel.
Muting and Unmuting
Moderators can mute and unmute users. When a user is muted, they cannot send messages in a channel. However, muted users will still be allowed to observe messages in a channel. The status of being muted is indefinite but is only applied at the channel level. The mute and unmute operations can be done via AmityChannel
object
Mute Users
When a user is muted, all messages sent by that user to that channel will be rejected. This method is useful for preventing certain users from sending inappropriate messages, but still allowing them to participate in the conversation in a read-only manner. The timeout property allows you to make the timeout temporary, or permanent until unset by passing in -1
.
The above logic will mute user1
in the selected channel for 10 minutes.
If you want to permanently mute a user, pass in
Duration.millis(-1)
as thetimeout
. The user will stay muted until you explicitly unmute that user.
To unmute a user
Note: This feature is not applicable in Broadcast
and Conversation
channel. Calling muteMembers()
or unmuteMembers()
on these channels will result in an error.
Last updated