summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alternativ_nick.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/alternativ_nick.py b/alternativ_nick.py
index aae2435..9041f21 100644
--- a/alternativ_nick.py
+++ b/alternativ_nick.py
@@ -12,14 +12,18 @@ import threading
# Duration to wait before trying to get the nick again (in seconds)
-NICKLOOP_DELAY = 60
+DEFAULT_NICK_DELAY = 60
def _start_nickloop(phenny):
+ delay = getattr(phenny.config, 'nick_delay', DEFAULT_NICK_DELAY)
+ if not isinstance(delay, int):
+ return
+
def nickloop():
print >> sys.stderr, ('Trying to get: %s' % phenny.config.nick)
phenny.write(('NICK', phenny.config.nick))
- threading.Timer(NICKLOOP_DELAY, nickloop).start()
+ threading.Timer(delay, nickloop).start()
def _set_nick(wrapper, nick):