1
# gozerplugs/plugs/nickcapture.py
5
""" nick recapture callback. """
7
__copyright__ = 'this file is in the public domain'
9
from gozerbot.callbacks import callbacks
10
from gozerbot.plughelp import plughelp
12
plughelp.add('nickcapture', 'nickcapture takes a nick back if a user quits')
14
def ncaptest(bot, ievent):
16
""" test if user is splitted. """
18
if '*.' in ievent.txt or bot.server in ievent.txt:
21
if bot.orignick.lower() == ievent.nick.lower():
26
def ncap(bot, ievent):
28
""" recapture the nick. """
30
bot.donick(bot.orignick)
32
callbacks.add('QUIT', ncap, ncaptest, threaded=True)