toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    "id": id.toString(),
    "username": username,
    "discriminator": discriminator,
    "global_name": globalName,
    "avatar": avatar,
    if (bot != null) "bot": bot,
    if (system != null) "system": system,
    if (mfaEnabled != null) "mfa_enabled": mfaEnabled,
    if (banner != null) "banner": banner,
    if (accentColor != null) "accent_color": accentColor,
    if (locale != null) "locale": locale,
    if (verified != null) "verified": verified,
    if (email != null) "email": email,
    if (flags != null) "flags": flags!.value,
    if (premiumType != null) "premium_type": premiumType!.value,
    if (publicFlags != null) "public_flags": publicFlags!.value,
    if (decoration != null) "avatar_decoration_data": decoration!.toJson()
  };
}