resolve method

Future<Role> resolve(
  1. Snowflake id
)

Implementation

Future<Role> resolve (Snowflake id) async {
  if(cache.containsKey(id)) {
    return cache.getOrFail(id);
  }

  await sync();
  if (!cache.containsKey(id)) {
    throw ApiException('Unable to fetch role with id #$id');
  }

  return cache.getOrFail(id);
}