modify method

Future<Channel> modify(
  1. String channelId, {
  2. String? name,
  3. int? type,
  4. int? position,
  5. String? topic,
  6. bool? nsfw,
  7. int? rateLimitPerUser,
  8. int? bitrate,
  9. int? userLimit,
  10. List<Overwrite>? permissionOverwrites,
  11. String? parentId,
})

Implementation

Future<Channel> modify(
  String channelId, {
  String? name,
  int? type,
  int? position,
  String? topic,
  bool? nsfw,
  int? rateLimitPerUser,
  int? bitrate,
  int? userLimit,
  List<Overwrite>? permissionOverwrites,
  String? parentId,
}) {
  var endpoint = '/channels/$channelId';
  return _http.request(
    endpoint,
    converter: Channel.fromJson,
    method: 'patch',
    body: {
      ...insertNotNull('name', name),
      ...insertNotNull('type', type),
      'position': position,
      'topic': topic,
      'nsfw': nsfw,
      'rate_limit_per_user': rateLimitPerUser,
      'bitrate': bitrate,
      'user_limit': userLimit,
      'permission_overwrites': permissionOverwrites,
      'parent_id': parentId,
    },
  );
}