mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 09:19:23 +01:00
Integrate services_support and automode
New hook: PYLINK_SERVICE_JOIN
This commit is contained in:
parent
b3310eaf78
commit
4999ecd11f
@ -59,6 +59,7 @@ def spawn_service(irc, source, command, args):
|
||||
|
||||
for chan in channels:
|
||||
irc.proto.join(u, chan)
|
||||
irc.callHooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': chan, 'users': [u]}])
|
||||
|
||||
utils.add_hook(spawn_service, 'PYLINK_NEW_SERVICE')
|
||||
|
||||
@ -99,6 +100,7 @@ def handle_kick(irc, source, command, args):
|
||||
channel = args['channel']
|
||||
if irc.isServiceBot(kicked):
|
||||
irc.proto.join(kicked, channel)
|
||||
irc.callHooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': channel, 'users': [kicked]}])
|
||||
utils.add_hook(handle_kick, 'KICK')
|
||||
|
||||
def handle_commands(irc, source, command, args):
|
||||
|
@ -222,7 +222,8 @@ def handle_join(irc, source, command, args):
|
||||
for uid in args['users']:
|
||||
match(irc, channel, uid)
|
||||
utils.add_hook(handle_join, 'JOIN')
|
||||
utils.add_hook(handle_join, 'PYLINK_RELAY_JOIN') # Handle the relay verison of join
|
||||
utils.add_hook(handle_join, 'PYLINK_RELAY_JOIN') # Handle the relay version of join
|
||||
utils.add_hook(handle_join, 'PYLINK_SERVICE_JOIN') # And the version for service bots
|
||||
|
||||
def handle_services_login(irc, source, command, args):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user