fix autolink to use scryfall data type
This commit is contained in:
parent
1c870b58e4
commit
4e6d648d18
@ -26,21 +26,27 @@ impl AutolinkModule {
|
||||
}
|
||||
|
||||
fn print_mtg_card (card: &MtgCard, message: &Message) {
|
||||
message.reply(&format!("{}", card.image_url));
|
||||
if let Some(ref image_uris) = card.image_uris {
|
||||
if let Some(ref image_uri) = image_uris.get("normal") {
|
||||
message.reply(&format!("{}", image_uri));
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ref cost) = card.cost {
|
||||
if let Some(ref cost) = card.mana_cost {
|
||||
message.reply(&format!("**{}** (**{}**)", card.name, cost));
|
||||
} else {
|
||||
message.reply(&format!("**{}**", card.name));
|
||||
}
|
||||
|
||||
message.reply(&format!("**{}**", card.typeline));
|
||||
if let Some(ref typeline) = card.type_line {
|
||||
message.reply(&format!("**{}**", typeline));
|
||||
}
|
||||
|
||||
if let Some(ref rules) = card.rules {
|
||||
if let Some(ref rules) = card.oracle_text {
|
||||
message.reply(&format!("{}", rules));
|
||||
}
|
||||
|
||||
if let Some(ref flavor) = card.flavor {
|
||||
if let Some(ref flavor) = card.flavor_text {
|
||||
message.reply(&format!("*{}*", flavor));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user