When a user is muted, they can not send messages in a channel.
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.
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 by 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 an user, call EkoChannelModeration.unmuteUsers()
:
Note: This feature does not work with Broadcast
and Conversation
channel. Calling muteUsers()
or unMuteUsers()
on these channels will result in an error.