summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormogad0n2020-09-17 22:37:22 +0530
committermogad0n2020-09-17 22:37:22 +0530
commit7befb3d05c2cfb12842032ce037740ce354ed27f (patch)
tree3bc19855c5bdc92d6abe7aaf4ed3c9aece9a46cd
parentbb9e80408842a7f48859aab9926fb678978fb18d (diff)
downloadtripsit-7befb3d05c2cfb12842032ce037740ce354ed27f.tar.gz
tripsit-7befb3d05c2cfb12842032ce037740ce354ed27f.tar.bz2
tripsit-7befb3d05c2cfb12842032ce037740ce354ed27f.zip
fix Type Errors again
-rw-r--r--plugin.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugin.py b/plugin.py
index addc3ef..c28194e 100644
--- a/plugin.py
+++ b/plugin.py
@@ -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()