parse method
Parse the raw
data received from the API into an instance of the type of this manager.
Implementation
@override
Emoji parse(Map<String, Object?> raw) {
final isUnicode = raw['id'] == null;
if (isUnicode) {
return TextEmoji(
name: raw['name'] as String,
manager: this,
id: Snowflake.zero,
);
}
return GuildEmoji(
id: Snowflake.parse(raw['id']!),
manager: this,
user: maybeParse(raw['user'], client.users.parse),
isAnimated: raw['animated'] as bool?,
isAvailable: raw['available'] as bool?,
isManaged: raw['managed'] as bool?,
requiresColons: raw['require_colons'] as bool?,
name: raw['name'] as String?,
roleIds: maybeParseMany(raw['roles'], Snowflake.parse),
);
}