MemberRoleManager.fromList constructor

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

Implementation

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

  return MemberRoleManager(roles);
}