3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

example, relay_cb: migrate to irc.is_channel

This commit is contained in:
James Lu 2017-08-30 21:22:19 -07:00
parent 36d6581bba
commit 85a7dd3dff
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ def hook_privmsg(irc, source, command, args):
# irc.pseudoclient stores the User object of the main PyLink client.
# (i.e. the user defined in the bot: section of the config)
if utils.isChannel(channel) and irc.pseudoclient.nick in text:
if irc.is_channel(channel) and irc.pseudoclient.nick in text:
irc.msg(channel, 'hi there!')
# log.debug, log.info, log.warning, log.error, log.exception (within except: clauses)
# and log.critical are supported here.

View File

@ -60,7 +60,7 @@ def cb_relay_core(irc, source, command, args):
real_command = 'ACTION'
elif not utils.isChannel(args['target']):
elif not irc.is_channel(args['target']):
# Target is a user; handle this accordingly.
if relay_conf.get('allow_clientbot_pms'):
real_command = 'PNOTICE' if args.get('is_notice') else 'PM'
@ -112,7 +112,7 @@ def cb_relay_core(irc, source, command, args):
# Figure out where the message is destined to.
target = args.get('channel') or args.get('target')
if target is None or not (utils.isChannel(target) or private):
if target is None or not (irc.is_channel(target) or private):
# Non-channel specific message (e.g. QUIT or NICK). If this isn't a PM, figure out
# all channels that the sender shares over the relay, and relay them to those
# channels.