modify method
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,
})
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,
},
);
}