fix Type Errors again

This commit is contained in:
mogad0n 2020-09-17 22:37:22 +05:30
parent bb9e804088
commit 7befb3d05c
1 changed files with 4 additions and 7 deletions

View File

@ -149,7 +149,7 @@ class Tripsit(callbacks.Plugin):
combo = wrap(combo, [("something"), ("something")])
@wrap(idose, [("something"), ("something"), optional("something"), optional("something")])
@wrap(["something", "something", optional("something"), optional("something")])
def idose(self, irc, msg, args, dose, name, method, ago):
"""<amount> <drug> [<method>] [<ago>]
@ -161,7 +161,7 @@ class Tripsit(callbacks.Plugin):
onset = None
if not r['err']:
drug = r['data'][0]
drug_name = r['data'][0]['pretty_name']
drug_name = drug['pretty_name']
method_keys = ['value']
methods = []
if method:
@ -181,17 +181,14 @@ class Tripsit(callbacks.Plugin):
if onset and "_unit" in drug["formatted_onset"]:
onset = "%s %s" % (
onset, drug["formatted_onset"]["_unit"])
drug_and_method = drug_name
else:
drug_name = name
drug_and_method = name
drug_and_method = name
if method:
if not found_method:
method = method.title()
drug_and_method = "%s via %s" % (drug_and_method, method)
hours = int(ago[0:2])
minutes = int(ago[2:4])
time = datetime.datetime.utcnow()