dronefly-garden / dronefly

Red Discord Bot V3 cogs for naturalists.
Other
16 stars 3 forks source link

map: Support shorthand for output of lists of names #34

Open synrg opened 5 years ago

synrg commented 5 years ago

Similar to https://github.com/synrg/quaggagriff/issues/32 , when outputting a map for a long list of names of species, any repeatedly mentioned genera should be abbreviated in the output.

e.g. currently, a query like this results in abbreviated title to fit within the 256 character limit for Discord embed titles:

/map south leopard frog, north leopard frog, rio leopard frog, plains leopard frog,
lowland leopard frog, chiri leopard frog, atlantic leopard frog, relict leopard frog

=>

Range map for Lithobates sphenocephalus (Southern Leopard Frog), Lithobates
pipiens (Northern Leopard Frog), Lithobates berlandieri (Rio Grande Leopard Frog),
Lithobates blairi (Plains Leopard Frog), and 4 more

ideally that should be:

Range map for Lithobates sphenocephalus (Southern Leopard Frog), L. pipiens
(Northern Leopard Frog), L. berlandieri (Rio Grande Leopard Frog), L. blairi (Plains
Leopard Frog), and 4 more

And because this trims out 8 characters per "Lithobates" => "L." times 3, there are 24 more characters available in the line, so it would appear at least one more "L. epithet" could then fit in the title, if not more.