send static method
Send message message
to conversation with id conversationId
.
Implementation
static Future<Message> send(
String conversationId,
Message message, {
Uint8List? image,
}) async {
MercuryRequest req = await _req();
req.message = Message(text: message.text, conversationId: conversationId);
if (message.replyTo.hasId())
req.message.replyTo = Message(id: message.replyTo.id);
if (image != null) {
MercuryResponse res = await _client.uploadImage(_imageStream(image));
//TODO: req.message.images = [image];
}
MercuryResponse res = await _client.send(req);
return res.message;
}