buildVotePoll static method
Only supports group channel
Implementation
static Command buildVotePoll({
required int pollId,
required List<int> pollOptionIds,
required String channelUrl,
required ChannelType channelType,
String? requestId,
}) {
if (channelType == ChannelType.open) {
throw SBError(message: "Vote Message only supports group channel");
}
final payload = <String, dynamic>{
'channel_url': channelUrl,
'channel_type':
channelType.commandString, // Currently only supports group channel
'poll_id': pollId,
'option_ids': pollOptionIds,
};
return Command(
cmd: CommandString.pollVote,
payload: payload,
requestId: requestId,
);
}