Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created March 21, 2022 01:42
Show Gist options
  • Save sendbird-community/f8f936f286a9576323ebec8b94c37b32 to your computer and use it in GitHub Desktop.
Save sendbird-community/f8f936f286a9576323ebec8b94c37b32 to your computer and use it in GitHub Desktop.
const onBeforeUpdateUserMessage = (text) => {
updateChannelParams();
const userMessageParams = new sdk.UserMessageParams();
var jsonMessageData = {
type: "VOTING_APP",
version: 1,
title: `${text}`,
};
var jsonString = JSON.stringify(jsonMessageData);
userMessageParams.data = jsonString;
userMessageParams.customType = "VOTING_APP";
userMessageParams.message = text;
return userMessageParams;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment