3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

Integrate services_support and automode

New hook: PYLINK_SERVICE_JOIN
This commit is contained in:
James Lu 2016-07-07 21:54:59 -07:00
parent b3310eaf78
commit 4999ecd11f
2 changed files with 4 additions and 1 deletions

View File

@ -59,6 +59,7 @@ def spawn_service(irc, source, command, args):
for chan in channels: for chan in channels:
irc.proto.join(u, chan) irc.proto.join(u, chan)
irc.callHooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': chan, 'users': [u]}])
utils.add_hook(spawn_service, 'PYLINK_NEW_SERVICE') utils.add_hook(spawn_service, 'PYLINK_NEW_SERVICE')
@ -99,6 +100,7 @@ def handle_kick(irc, source, command, args):
channel = args['channel'] channel = args['channel']
if irc.isServiceBot(kicked): if irc.isServiceBot(kicked):
irc.proto.join(kicked, channel) irc.proto.join(kicked, channel)
irc.callHooks([irc.sid, 'PYLINK_SERVICE_JOIN', {'channel': channel, 'users': [kicked]}])
utils.add_hook(handle_kick, 'KICK') utils.add_hook(handle_kick, 'KICK')
def handle_commands(irc, source, command, args): def handle_commands(irc, source, command, args):

View File

@ -222,7 +222,8 @@ def handle_join(irc, source, command, args):
for uid in args['users']: for uid in args['users']:
match(irc, channel, uid) match(irc, channel, uid)
utils.add_hook(handle_join, 'JOIN') 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): def handle_services_login(irc, source, command, args):
""" """