diff --git a/plugin.py b/plugin.py index 68dc78f..4521245 100644 --- a/plugin.py +++ b/plugin.py @@ -257,7 +257,7 @@ class Tripsit(callbacks.Plugin): re += utils.str.format(". You should have/will start feeling effects %s from/after dosing", onset) irc.reply(re) - @wrap([optional('postiveInt')]) + @wrap([optional('positiveInt')]) def undose(self, irc, msg, args, entry): """ @@ -281,8 +281,7 @@ class Tripsit(callbacks.Plugin): else: irc.error(f'No doses saved for {nick}') - @wrap() - def doseslogged(self, irc, msg, args, history): + def doseslogged(self, irc, msg, args): """ This command takes no arguments. @@ -300,6 +299,7 @@ class Tripsit(callbacks.Plugin): else: irc.error(f"No doses saved for {nick}") + doseslogged = wrap(doseslogged) @wrap([optional('positiveInt')]) def lastdose(self, irc, msg, args, history): @@ -328,9 +328,9 @@ class Tripsit(callbacks.Plugin): since_dose_seconds = since_dose.total_seconds() if history: history = num2words(history, to='ordinal') - re = utils.str.format("Your %i last dose was %s of %s via %s at %s %s, %T ago", history, dose, drug, method, str(dose_time), timezone, since_dose_seconds) + re = utils.str.format("Your %i last dose was %s of %s via %s at %s %s, %T ago", history, dose, drug, method, dose_time.strftime("%c"), timezone, since_dose_seconds) else: - re = utils.str.format("You last dosed %s of %s via %s at %s %s, %T ago", dose, drug, method, str(dose_time), timezone, since_dose_seconds) + re = utils.str.format("You last dosed %s of %s via %s at %s %s, %T ago", dose, drug, method, dose_time.strftime("%c"), timezone, since_dose_seconds) irc.reply(re) else: irc.error(f'No doses saved for {nick}') diff --git a/requirements.txt b/requirements.txt index 51f1ef9..ab4b237 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ docopt==0.6.2 num2words==0.5.10 pytz==2020.5 +humanize==3.10.0