Last active
February 11, 2022 17:24
-
-
Save sendbird-community/620aeed5a7049e83ccc9f65c21be14c4 to your computer and use it in GitHub Desktop.
banUser function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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