summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormogad0n2020-09-17 22:48:05 +0530
committermogad0n2020-09-17 22:48:05 +0530
commitfe08351275b5f497eb577d5d74a9ab75a1012054 (patch)
tree65f7677938808112fe3c02e669675f7edee35317
parent2a78fb0b1ffbf38007d872e0f5c8c1890bb5f704 (diff)
downloadtripsit-fe08351275b5f497eb577d5d74a9ab75a1012054.tar.gz
tripsit-fe08351275b5f497eb577d5d74a9ab75a1012054.tar.bz2
tripsit-fe08351275b5f497eb577d5d74a9ab75a1012054.zip
fix Type Errors again and again
-rw-r--r--plugin.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugin.py b/plugin.py
index fc2373f..44aca37 100644
--- a/plugin.py
+++ b/plugin.py
@@ -181,17 +181,16 @@ class Tripsit(callbacks.Plugin):
if onset and "_unit" in drug["formatted_onset"]:
onset = "%s %s" % (
onset, drug["formatted_onset"]["_unit"])
-
+ drug_and_method = name
if method:
if not found_method:
method = method.title()
drug_and_method = "%s via %s" % (drug_and_method, method)
else:
- drug_and_method = name
- method = 'Undefined'
+ method = 'Undefined/Probably boofed'
+
+
- hours = int(ago[0:2])
- minutes = int(ago[2:4])
time = datetime.datetime.utcnow()
if not ago:
self.db[msg.nick] = {'type': 'idose' ,'time': str(time), 'dose': dose, 'drug': name, 'method': method }
@@ -199,6 +198,8 @@ class Tripsit(callbacks.Plugin):
if not onset == None:
re += f". You should start feeling effects {onset} from now"
else:
+ hours = int(ago[0:2])
+ minutes = int(ago[2:4])
dose_td = datetime.timedelta(hours=hours, minutes=minutes)
time_dosed = time - dose_td
self.db[msg.nick] = {'type': 'hdose', 'time': str(time), 'time_dosed': str(time_dosed), 'dose': dose, 'drug': name, 'method': method }