ForumChannel.fromPayload constructor

ForumChannel.fromPayload(
  1. dynamic payload
)

Implementation

factory ForumChannel.fromPayload(dynamic payload) {
  final permissionOverwriteManager = PermissionOverwriteManager();
  for (dynamic element in payload['permission_overwrites']) {
    final PermissionOverwrite overwrite = PermissionOverwrite.from(payload: element);
    permissionOverwriteManager.cache.putIfAbsent(overwrite.id, () => overwrite);
  }

  return ForumChannel(
    payload['guild_id'],
    payload['parent_id'],
    payload['name'],
    payload['type'],
    payload['position'],
    payload['flags'],
    permissionOverwriteManager,
    payload['id'],
    ForumDiscussionManager(payload['id']),
  );
}