sendCreatePollMessage method

Future<Message?> sendCreatePollMessage({
  1. required String phone,
  2. required String pollName,
  3. required List<String> pollOptions,
})

Send a create poll message , Note: This only works for groups

Implementation

Future<Message?> sendCreatePollMessage(
    {required String phone,
    required String pollName,
    required List<String> pollOptions}) async {
  var result = await wpClient.evaluateJs(
    '''window.WPP.chat.sendCreatePollMessage(${phone.phoneParse},${pollName.jsParse},${pollOptions.jsParse});''',
    methodName: "sendCreatePollMessage",
  );
  return Message.parse(result).firstOrNull;
}