createChannel method
Future<Channel>
createChannel(
- String guildId, {
- required String name,
- int? type,
- String? topic,
- int? bitrate,
- int? userLimit,
- int? rateLimitPerUser,
- int? position,
- List<Overwrite>? permissionOverwrites,
- String? parentId,
- bool? nsfw,
})
Implementation
Future<Channel> createChannel(
String guildId, {
required String name,
int? type,
String? topic,
int? bitrate,
int? userLimit,
int? rateLimitPerUser,
int? position,
List<Overwrite>? permissionOverwrites,
String? parentId,
bool? nsfw,
}) {
var endpoint = '/guilds/$guildId/channels';
return _http.request(
endpoint,
converter: Channel.fromJson,
method: 'post',
body: {
'name': name,
'type': type,
'topic': topic,
'bitrate': bitrate,
'user_limit': userLimit,
'rate_limit_per_user': rateLimitPerUser,
'position': position,
'permission_overwrites': permissionOverwrites,
'parent_id': parentId,
'nsfw': nsfw,
}..filterNullValues(),
);
}