build method

  1. @override
RawApiMap build()
override

Builds object to Map() instance;

Implementation

@override
RawApiMap build() {
  if (name == null || name!.isEmpty) {
    throw EmbedBuilderArgumentException("Author name cannot be null or empty");
  }

  if (length! > 256) {
    throw EmbedBuilderArgumentException("Author name is too long. (256 characters limit)");
  }

  return <String, dynamic>{"name": name, if (url != null) "url": url, if (iconUrl != null) "icon_url": iconUrl};
}