dosebotredux / DosebotRedux

The Unlicense
31 stars 8 forks source link

fix: `/info` substance parsing #22

Closed 5HT2 closed 1 year ago

5HT2 commented 1 year ago

Currently, the locateSubstanceSheet function indexes substances using their Proper Name. but uses the parsedname when searching it, so it isn't really ever used for drugs that contain a space in their name (such as Psilocybin mushrooms).

This changes it to index by the parsedname as well as use .includes(drug_lowercased) rather than match whole, because users might not type out the full name.

Please let me know if you'd like this accomplished differently, I'm not sure if you'd rather use sanitize-substance-name (and add aliases for mushrooms / shrooms) to accomplish this.

image