From e061f4dd6d4202196b0e15cc0d92beb9127b8e79 Mon Sep 17 00:00:00 2001 From: neersighted Date: Thu, 1 Mar 2012 01:24:15 -0800 Subject: [PATCH] fixed bug in stayalive code --- core/config.py | 4 ++-- plugins/misc.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/config.py b/core/config.py index 644f07d..e7168b0 100755 --- a/core/config.py +++ b/core/config.py @@ -23,8 +23,8 @@ if not os.path.exists('config'): "invitejoin": true, "autorejoin": false, "command_prefix": ".", - "stayalive": "", - "stayalive_delay": "20" + "stayalive": true, + "stayalive_delay": 20 } }, "disabled_plugins": [], diff --git a/plugins/misc.py b/plugins/misc.py index aa80517..4a82252 100755 --- a/plugins/misc.py +++ b/plugins/misc.py @@ -18,7 +18,7 @@ def invite(paraml, conn=None): return None -# Rejoin on kick (Configuragble, defaults to False) +# Rejoin on kick (Configurable, defaults to False) @hook.event('KICK') def rejoin(paraml, conn=None): autorejoin = conn.conf.get('autorejoin', False) @@ -56,6 +56,7 @@ def onjoin(paraml, conn=None, bot=None): # Stay-alive code stayalive = conn.conf.get('stayalive') if stayalive: + delay = conn.conf.get('stayalive_delay', 20) while True: - time.sleep(conn.conf.get('stayalive_delay', 20)) + time.sleep(delay) conn.cmd('PING', [conn.nick])