RoleManager.fromList constructor

RoleManager.fromList(
  1. List<Role> payload
)

Implementation

factory RoleManager.fromList(List<Role> payload) {
  final roles = Map<Snowflake, Role>.from(payload.fold({}, (value, element) {
    return {...value, element.id: element};
  }));

  return RoleManager(roles);
}