]>
jfr.im git - z_archive/Ophion.git/blob - modules/autoload/chkick.py
6 cache
.currmod
= __name__
7 cache
.hookcmd('KICK', 3, kick
, 1, helpkick
)
8 cache
.hookcmd('BAN', 3, ban
, 1, helpban
)
9 def deinit(cache
, reloading
=False):
10 cache
.currmod
= __name__
11 cache
.unhookcmd('KICK')
12 cache
.unhookcmd('BAN')
14 def kick(nick
, target
, params
, bot
, cache
):
15 pieces
= params
.split(None, 1)
16 reason
= "Requested by %s" % (nick
)
18 reason
= "%s (%s)" % (pieces
[1], reason
)
19 bot
.raw("KICK %s %s :%s" % (target
, pieces
[0], reason
))
21 def ban(nick
, target
, params
, bot
, cache
):
22 bot
.raw("MODE %s +b %s" % (target
, pieces
[0]))
23 bot
.msg(nick
, "Done.")
25 def helpkick(): return ['KICK <#channel> [<reason>]', 'Kicks <user>']
26 def helpban(): return ['BAN <hostmask>', 'Bans <hostmask>. (Doesn\'t kick)']