update docstring

This commit is contained in:
Pratyush Desai 2022-02-28 07:30:05 +05:30
parent 0b37281fb3
commit 25c5ab434b
Signed by: pratyush
GPG Key ID: DBA5BB7505946FAD

View File

@ -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):