Channel Moderation

Channel Moderation is an essential feature for creating a safe and engaging chat community. With Amity Chat SDK, developers can use moderation to manage chat channels effectively and ensure that the chat community remains safe and welcoming. Moderation features such as user banning and muting can help prevent inappropriate content and maintain a positive chat environment.

Add / Remove Roles

Roles define varying levels of access and permissions that can be assigned to users within a chat channel. Each role is defined by a set of permissions that determine what actions a user can perform within the channel.

Roles can be assigned to users based on factors such as their level of participation in the chat community or their specific responsibilities within the channel. For example, a moderator might have the ability to remove inappropriate messages or ban users from the channel, while a regular user might only have the ability to send and receive messages.

You can use ChannelRepository class to add / remove users from a role

  1. The channel creator is automatically assigned as the channel moderator.

  2. The previous/last moderator is not allowed to leave a community and an error is displayed.

  3. The channel moderator can promote a user/member to moderator.

  4. The channel moderator can demote a moderator to a user/member.

This applies only to Live and Community channels’. This does not apply to Conversation Channel.

Permission

You can check your permission in channel by sending Permission enums to CoreClient.hasPermission(amityPermission).

Add / Remove Members

AmityChannelMembership provides methods to add and remove members, as well as removing yourself as a member of the channel (leaving the channel).

  • channelId: The ID of the channel to which you want to add or remove members.

  • userIds: An array of user IDs to be added to the channel or removed from the channel.

Ban / Unban Members

ChannelRepository class also provides various methods to moderate the users present in channel. You can ban/unban users, assign roles or remove it from user.

For the banMembers function, the following parameters are required:

  • channelId: The ID of the channel from which the members are being banned.

  • userIds: An array of user IDs to be banned from the channel.

For the unbanMembers function, the following parameters are required:

  • channelId: The ID of the channel from which the members are being unbanned.

  • userIds: An array of user IDs to be unbanned from the channel.

Last updated