Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Last active February 11, 2022 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/620aeed5a7049e83ccc9f65c21be14c4 to your computer and use it in GitHub Desktop.
Save sendbird-community/620aeed5a7049e83ccc9f65c21be14c4 to your computer and use it in GitHub Desktop.
banUser function
var apiInstance = new SendbirdPlatformSdk.GroupChannelApi();
apiInstance.apiClient.basePath = `https://api-${process.env.APP_ID}.sendbird.com`;
function banUser(channelUrl, senderId) {
var seconds = 86400;
var description = "Toxic message sent- User will be banned for 1 day";
var agentId = 0;
var opts = {
apiToken: process.env.API_TOKEN,
gcBanUserData: new SendbirdPlatformSdk.GcBanUserData(
channelUrl,
senderId,
agentId,
seconds,
description
),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment