1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-22 17:44:22 +00:00

Add CardRarity::discord_emoji()

This commit is contained in:
Steffo 2023-10-23 00:30:14 +02:00
parent c8c389c0b1
commit 97899f3ca2
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -38,6 +38,18 @@ impl CardRarity {
) -> Option<&'hm LocalizedCardRarity> {
hm.get(self)
}
/// Get the Discord emoji code associated with this [`CardRarity`].
pub fn discord_emoji(&self) -> &'static str {
match self {
CardRarity::None => "",
CardRarity::Common => "<:common:1056024315046412358>",
CardRarity::Rare => "<:rare:1056022907433799690>",
CardRarity::Epic => "<:epic:1056023004028608622>",
CardRarity::Champion => "<:champion:1056024303856001034>",
CardRarity::Unsupported => "",
}
}
}
#[cfg(test)]