Mute a list of channel members

When a user is muted, they can not send messages in a channel.

Muting and Unmuting

Moderators can mute and unmute members. When a user is muted, they cannot send messages in a channel. However, muted members 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.

Mute Members

When a user is muted, all messages sent by that user to that channel will be rejected. This method is useful for preventing certain members 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.

// mute user with id `user1` for 10 minutes
let moderation = AmityChannelModeration(client: <amity-client>, channel: <channel-id>)

moderation.muteMembers(["user1"], mutePeriod: 600) { (success, error) in
  ...
}

If you want to permanently mute a user, pass in -1 as the mutePeriod. The user will stay muted until you explicitly unmute that user.

To unmute an user, call unmuteMembers:

let moderation = AmityChannelModeration(client: <amity-client>, channel: <channel-id>)

moderation.unmuteMembers(["user1"]) { (success, error) in
  ...
}

Last updated