sendMessage method
Send a message to a channel.
Implementation
Future<FirestackMessage> sendMessage({
required String channelId,
required String body,
String type = 'text',
Map<String, dynamic>? metadata,
int? replyToId,
}) async {
final response = await _client.post('channels/$channelId/messages', body: {
'body': body,
'type': type,
if (metadata != null) 'metadata': metadata,
if (replyToId != null) 'reply_to_id': replyToId,
});
return FirestackMessage.fromJson(response['data'] as Map<String, dynamic>);
}