diff options
| author | Pratyush Desai | 2022-02-28 07:30:05 +0530 |
|---|---|---|
| committer | Pratyush Desai | 2022-02-28 07:30:05 +0530 |
| commit | 25c5ab434bf2884ba5aa2f931284fe5d62c0c4b9 (patch) | |
| tree | d3472988ef408749b2d3b5ee29ee8aff4228e152 | |
| parent | 0b37281fb3440efd96bb2443a5e0ab3e10b1844e (diff) | |
| download | psychonautwiki-25c5ab434bf2884ba5aa2f931284fe5d62c0c4b9.tar.gz psychonautwiki-25c5ab434bf2884ba5aa2f931284fe5d62c0c4b9.tar.bz2 psychonautwiki-25c5ab434bf2884ba5aa2f931284fe5d62c0c4b9.zip | |
| -rw-r--r-- | plugin.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -50,11 +50,13 @@ class PsychonautWiki(callbacks.Plugin): @wrap(['something', optional('something')]) def psywiki(self, irc, msg, args, name, category): - """<drug> <category> - fetches data on drug from psychonautwiki. Categories currently supported are name, dose, duration + """<drug> [<category>] + + fetches data on <drug> from psychonautwiki. Lists categories available if <category> not provided. + Categories currently supported are name, dose, duration, effects, addictionPotential, crossTolerances, toxicity """ - categories = ['name', 'summary', 'dose', 'duration', 'effects', 'addictionPotential', 'crossTolerances', 'toxicity'] - query = { 'query' : 'query getdruginfo($name: String){substances(query: $name) {name summary toxicity addictionPotential crossTolerances effects { name } roas {name dose {units threshold heavy common { min max } light { min max } strong { min max }} duration {afterglow { min max units } comeup { min max units } duration { min max units } offset { min max units } onset { min max units }peak { min max units }total { min max units }}}}}', 'variables': {'name': name}} + categories = ['name', 'summary', 'dose', 'duration', 'BA' 'effects', 'addictionPotential', 'crossTolerances', 'toxicity'] + query = { 'query' : 'query getdruginfo($name: String){substances(query: $name) {name summary toxicity addictionPotential crossTolerances effects { name } roas {name dose {units threshold heavy common { min max } light { min max } strong { min max }} duration {afterglow { min max units } comeup { min max units } duration { min max units } offset { min max units } onset { min max units } peak { min max units } total { min max units }}}}}', 'variables': {'name': name}} r = requests.post(url=url, json=query).json() def format_dose(dose, unit): |
