serialize property

  1. @override
Map<String, dynamic> get serialize
override

Implementation

@override
Map<String, dynamic> get serialize => {
  ...super.serialize,
  'type': CommandType.subcommand.type,
  'options': subcommands.isNotEmpty || groups.isNotEmpty
    ? [
    ...groups.map((group) => group.serialize).toList(),
    ...subcommands.map((command) => command.serialize).toList()
    ]
    : options.isNotEmpty
      ? [...options.map((option) => option.serialize)]
      : [],
  'default_member_permissions': !everyone
    ? permissions.isNotEmpty
      ? Helper.toBitfield(permissions.map((e) => e.value).toList()).toString()
      : null
    : 0,
  'nsfw': nsfw
};