From 25c5ab434bf2884ba5aa2f931284fe5d62c0c4b9 Mon Sep 17 00:00:00 2001 From: Pratyush Desai Date: Mon, 28 Feb 2022 07:30:05 +0530 Subject: [PATCH] update docstring --- plugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin.py b/plugin.py index be17684..99eef73 100644 --- a/plugin.py +++ b/plugin.py @@ -50,11 +50,13 @@ class PsychonautWiki(callbacks.Plugin): @wrap(['something', optional('something')]) def psywiki(self, irc, msg, args, name, category): - """ - fetches data on drug from psychonautwiki. Categories currently supported are name, dose, duration + """ [] + + fetches data on from psychonautwiki. Lists categories available if 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):