build method

RawApiMap build()
override

Returns built response for api

Implementation

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