diff options
| author | mogad0n | 2020-09-17 22:37:22 +0530 |
|---|---|---|
| committer | mogad0n | 2020-09-17 22:37:22 +0530 |
| commit | 7befb3d05c2cfb12842032ce037740ce354ed27f (patch) | |
| tree | 3bc19855c5bdc92d6abe7aaf4ed3c9aece9a46cd | |
| parent | bb9e80408842a7f48859aab9926fb678978fb18d (diff) | |
| download | tripsit-7befb3d05c2cfb12842032ce037740ce354ed27f.tar.gz tripsit-7befb3d05c2cfb12842032ce037740ce354ed27f.tar.bz2 tripsit-7befb3d05c2cfb12842032ce037740ce354ed27f.zip | |
fix Type Errors again
| -rw-r--r-- | plugin.py | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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() |
