replySendMessage method

Future<List<MessageModel>> replySendMessage({
  1. String? message,
  2. int? randomId,
  3. String? domain,
  4. int? guid,
  5. int? lat,
  6. int? long,
  7. List? attachment,
  8. List<int>? forwardMessages,
  9. int? stickerId,
  10. VkDartKeyboard? keyboard,
  11. Map<String, dynamic>? template,
  12. String? payload,
  13. Map<String, dynamic>? contentSource,
  14. bool? dontParseLinks,
  15. bool? disableMentions,
  16. String? intent,
  17. int? subscribeId,
})

Responds to a message in the dialog from which the event came. More detailed documentation: sendMessage

Sample example:

vkdart
  .onMessage()
  .where((event) => event.isInbox)
  .listen((event) => event.replySendMessage(message: 'Hello, @id${event.senderId!}'));

Implementation

Future<List<MessageModel>> replySendMessage(
    {String? message,
    int? randomId,
    String? domain,
    int? guid,
    int? lat,
    int? long,
    List<dynamic>? attachment,
    List<int>? forwardMessages,
    int? stickerId,
    VkDartKeyboard? keyboard,
    Map<String, dynamic>? template,
    String? payload,
    Map<String, dynamic>? contentSource,
    bool? dontParseLinks,
    bool? disableMentions,
    String? intent,
    int? subscribeId}) {
  final forwardOptions = {
    'peer_id': peerId,
    'is_reply': true,
    if (conversationMessageId != null)
      'conversation_message_ids': conversationMessageId
    else
      'message_ids': id
  };

  return sendMessage(
    message: message,
    randomId: randomId,
    domain: domain,
    guid: guid,
    lat: lat,
    long: long,
    attachment: attachment,
    forward: forwardOptions,
    stickerId: stickerId,
    keyboard: keyboard,
    template: template,
    payload: payload,
    contentSource: contentSource,
    dontParseLinks: dontParseLinks,
    disableMentions: disableMentions,
    intent: intent,
    subscribeId: subscribeId,
  );
}