Role.from constructor

Role.from({
  1. required GuildRoleManager roleManager,
  2. dynamic payload,
})

Implementation

factory Role.from({ required GuildRoleManager roleManager, dynamic payload }) {
  return Role(
    payload['id'],
    payload['name'],
    payload['color'],
    payload['hoist'],
    payload['icon'],
    payload['unicode_emoji'],
    payload['position'],
    payload['permissions'] is String
      ? int.parse(payload['permissions'])
      : payload['permissions'],
    payload['managed'] ?? false,
    payload['mentionable'] ?? false,
    payload['tags'] != null ? Tag.from(payload: payload['tags']) : null,
    roleManager,
  );
}