build method

RawApiMap build([
  1. AllowedMentions? defaultAllowedMentions
])

Implementation

RawApiMap build([AllowedMentions? defaultAllowedMentions]) {
  allowedMentions ??= defaultAllowedMentions;

  return <String, dynamic>{
    ...?flags?.build(),
    "content": content.toString(),
    if (embeds != null) "embeds": [for (final e in embeds!) e.build()],
    if (allowedMentions != null) "allowed_mentions": allowedMentions!.build(),
    if (replyBuilder != null) "message_reference": replyBuilder!.build(),
    if (tts != null) "tts": tts,
    if (nonce != null) "nonce": nonce,
    if (attachments != null) "attachments": [for (final attachmentBuilder in attachments!) attachmentBuilder.build()],
  };
}