ChannelBuilder.fromTextChannel constructor

ChannelBuilder.fromTextChannel({
  1. String? label,
  2. String? description,
  3. Snowflake? parentId,
  4. int? position,
  5. List<PermissionOverwrite>? permissions,
  6. bool? nsfw,
  7. int? rateLimitPerUser,
})

Implementation

factory ChannelBuilder.fromTextChannel ({
  String? label,
  String? description,
  Snowflake? parentId,
  int? position,
  List<PermissionOverwrite>? permissions,
  bool? nsfw,
  int? rateLimitPerUser,
}) {
  return ChannelBuilder({
    'type': ChannelType.guildText.value,
    'name': label,
    'topic': description,
    'parent_id': parentId,
    'position': position,
    'permission_overwrites': permissions?.map((permission) => permission.toJson()).toList(),
    'nsfw': nsfw,
    'rate_limit_per_user': rateLimitPerUser
  });
}