From: Thorsten Date: Tue, 28 Feb 2023 16:53:03 +0000 (+0100) Subject: fix ancient bug X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=9a026e5a8fd40bd9bb2a6c202dbc6168fb084979;p=urlbot-v3.git fix ancient bug --- diff --git a/distbot/plugins/basic.py b/distbot/plugins/basic.py index 15a4d00..139fa9b 100644 --- a/distbot/plugins/basic.py +++ b/distbot/plugins/basic.py @@ -10,7 +10,6 @@ from distbot.common.action import Action from distbot.common.config import conf_get from distbot.common.message import get_nick_from_message, get_words - logger = logging.getLogger(__name__) @@ -356,11 +355,7 @@ class TeaTimer(Worker): try: steep = int(words[1]) except ValueError as e: - return { - 'msg': sender + ': error when parsing int(%s): %s' % ( - words[1], str(e) - ) - } + return Action(msg=f"{sender}: error when parsing int(%s): %s" % (words[1], str(e))) ready = time.time() + steep @@ -371,7 +366,7 @@ class TeaTimer(Worker): return Action( msg=sender + ': Tea timer set to %s' % time.strftime('%Y-%m-%d %H:%M', time.localtime(ready)), - event=Action(time=ready, msg=(sender + ': Your tea is ready!'), mutex='teatimer_{}'.format(sender)) + event=Action(time=ready, msg=f'{sender}: Your tea is ready!', mutex=f'teatimer_{sender}') )