1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-10-16 09:37:27 +00:00

Add CardRegion::to_tag

This commit is contained in:
Steffo 2023-10-23 01:01:48 +02:00
parent 75aab93b57
commit 115af23e4b
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -112,6 +112,30 @@ impl CardRegion {
}
}
/// Get the long code of this [`CardRegion`].
///
/// If the region has no short code, it will return [`None`].
///
/// Used for deck hashtags in the Telegram bot.
pub fn to_tag(&self) -> Option<&'static str> {
match self {
Self::Demacia => Some("Demacia"),
Self::Freljord => Some("Freljord"),
Self::Ionia => Some("Ionia"),
Self::Noxus => Some("Noxus"),
Self::PiltoverZaun => Some("PiltoverZaun"),
Self::ShadowIsles => Some("ShadowIsles"),
Self::Bilgewater => Some("Bilgewater"),
Self::Shurima => Some("Shurima"),
Self::Targon => Some("Targon"),
Self::BandleCity => Some("BandleCity"),
Self::Runeterra => Some("Runeterra"),
_ => None,
}
}
/// Get the human friendly
/// Get the Discord emoji code associated with this [`CardRegion`].
pub fn discord_emoji(&self) -> &'static str {
match self {