<commit_before># jsb/plugs/nickcapture.py
#
#

""" nick recapture callback. """

## jsb imports

from jsb.lib.callbacks import callbacks

## callbacks

def ncaptest(bot, ievent):
    """ test if user is splitted. """
    if '*.' in ievent.txt or bot.server in ievent.txt:
        return 0
    if bot.nick.lower() == ievent.nick.lower():
        return 1
    return 0

def ncap(bot, ievent):
    """ recapture the nick. """
    bot.donick(bot.orignick)

callbacks.add('QUIT', ncap, ncaptest, threaded=True)<commit_msg>use bot.nick in nick recapture<commit_after># jsb/plugs/nickcapture.py
#
#

""" nick recapture callback. """

## jsb imports

from jsb.lib.callbacks import callbacks

## callbacks

def ncaptest(bot, ievent):
    """ test if user is splitted. """
    if '*.' in ievent.txt or bot.server in ievent.txt:
        return 0
    if bot.nick.lower() == ievent.nick.lower():
        return 1
    return 0

def ncap(bot, ievent):
    """ recapture the nick. """
    bot.donick(bot.nick)

callbacks.add('QUIT', ncap, ncaptest, threaded=True)
{'fraction_non_alphanumeric': 0.14613180515759314, 'fraction_numerical': 0.0057306590257879654, 'mean_word_length': 3.125984251968504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7032368', 'n_tokens_mistral': 384, 'n_tokens_neox': 368, 'n_words': 97}