jsb.plugs.core.underauth

handle non-ident connection on undernet.

jsb.plugs.core.underauth.pre_underauth_cb(bot, ievent)

Only respond to the message like: NOTICE AUTH :*** Your ident is disabled or broken, to continue to connect you must type /QUOTE PASS 16188.

jsb.plugs.core.underauth.underauth_cb(bot, ievent)

Send the raw command to the server.

CODE

# jsb/plugs/core/underauth.py
#
#

""" handle non-ident connection on undernet. """

jsb imports

from jsb.lib.callbacks import callbacks

pre_underauth_cb precondition

def pre_underauth_cb(bot, ievent):
    """
        Only respond to the message like:
        NOTICE AUTH :*** Your ident is disabled or broken, to continue
        to connect you must type /QUOTE PASS 16188.

    """
    args = ievent.arguments
    try: return (args[0] == 'AUTH' and args[-3] == '/QUOTE' and args[-2] == 'PASS')
    except Exception, ex: return False

underauth_cb callback

def underauth_cb(bot, ievent):
    """ Send the raw command to the server. """
    bot._raw(' '.join(ievent.arguments[-2:]))

callbacks.add('NOTICE', underauth_cb, pre_underauth_cb)

Table Of Contents

Previous topic

jsb.plugs.core.to

Next topic

jsb.plugs.core.uniq

This Page