I made a python script for Xchat that sets the channel mode +i(invite only), then it kicks the user you enter(word_eol[1]), pauses for 4 seconds, and then sets the channel mode -i. Its so people with Auto kick rejoin cant. But my problem is whenever I run it, it works, but it gives me this error:
TypeError: ik() takes exactly 2 arguments (3 given)
the only thing i can think of is because there is 2 xchat.command's in ik, but it still runs both so why even give such a lame error?
TypeError: ik() takes exactly 2 arguments (3 given)
the only thing i can think of is because there is 2 xchat.command's in ik, but it still runs both so why even give such a lame error?
Code:
import xchat
__module_name__ = "InviteKick"
__module_version__ = "1.0"
__module_description__ = "+i, kick, pause, -i"
knick = None
def ik(word_eol, userdata):
global knick
knick = word_eol[1]
xchat.command("mode +i")
xchat.command("kick" + knick)
xchat.hook_timer(4000, i)
return xchat.EAT_ALL
def i(userdata):
xchat.command("mode -i")
return xchat.EAT_ALL
xchat.hook_command('ik', ik)