build method

  1. @override
RawApiMap build()

Returns built response for api

Implementation

@override
RawApiMap build() => {
      "type": type.value,
      "name": name,
      "description": description,
      "default": defaultArg,
      "required": required,
      if (choices != null) "choices": choices!.map((e) => e.build()).toList(),
      if (options != null) "options": options!.map((e) => e.build()).toList(),
      if (channelTypes != null && type == CommandOptionType.channel) "channel_types": channelTypes!.map((e) => e.value).toList(),
      "autocomplete": autoComplete,
    };