diff options
-rw-r--r-- | slack/task.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/slack/task.py b/slack/task.py index e61ddb6..3c21415 100644 --- a/slack/task.py +++ b/slack/task.py @@ -270,7 +270,6 @@ async def gather( async def sleep(milliseconds: int): future = FutureTimer() - weechat.hook_timer( - milliseconds, 0, 1, get_callback_name(weechat_task_cb), future.id - ) + sleep_ms = milliseconds if milliseconds > 0 else 1 + weechat.hook_timer(sleep_ms, 0, 1, get_callback_name(weechat_task_cb), future.id) return await future |