createMessage method

Future<Message> createMessage(
  1. String channelId, {
  2. required String content,
  3. String? nonce,
  4. bool tts = false,
  5. Embed? embed,
  6. AllowedMentions? allowedMentions,
  7. MessageReference? messageReference,
})

Implementation

Future<Message> createMessage(
  String channelId, {
  required String content,
  String? nonce,
  bool tts = false,
  Embed? embed,
  AllowedMentions? allowedMentions,
  MessageReference? messageReference,
}) {
  var endpoint = '/channels/$channelId/messages';
  return _http.request(
    endpoint,
    converter: Message.fromJson,
    method: 'post',
    body: {
      'content': content,
      'nonce': nonce,
      'embed': embed,
      'allowed_mentions': allowedMentions,
      'message_reference': messageReference,
    },
  );
}