forwardTextMessage method

Future forwardTextMessage({
  1. required String phone,
  2. required MessageId messageId,
  3. bool displayCaptionText = false,
  4. bool multicast = false,
})

forwardTextMessage may throw errors if passed an invalid contact or if this method completed without any issue , then probably message sent successfully

Implementation

Future forwardTextMessage({
  required String phone,
  required MessageId messageId,
  bool displayCaptionText = false,
  bool multicast = false,
}) async {
  String? serialized = messageId.serialized;
  return await wpClient.evaluateJs(
      '''WPP.chat.forwardMessage(${phone.phoneParse}, ${serialized.jsParse}, {
          displayCaptionText: $displayCaptionText,
          multicast: $multicast,
        });''',
      methodName: "forwardMessage");
}