fix syntax

This commit is contained in:
Pratyush Desai 2021-07-14 06:46:42 +05:30
parent bf8d055424
commit 30289fd927
No known key found for this signature in database
GPG Key ID: EAA4FD0FB5CACA61
2 changed files with 6 additions and 5 deletions

View File

@ -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):
"""<n>
@ -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}')

View File

@ -1,3 +1,4 @@
docopt==0.6.2
num2words==0.5.10
pytz==2020.5
humanize==3.10.0