parseOptionChoice method

CommandOptionChoice parseOptionChoice(
  1. Map<String, Object?> raw
)

Parse a CommandOptionChoice from raw.

Implementation

CommandOptionChoice parseOptionChoice(Map<String, Object?> raw) {
  return CommandOptionChoice(
    name: raw['name'] as String,
    nameLocalizations: maybeParse(
      raw['name_localizations'],
      (Map<String, Object?> raw) => raw.map(
        (key, value) => MapEntry(Locale.parse(key), value as String),
      ),
    ),
    value: raw['value'],
  );
}