3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-09 02:54:14 +01:00

automode, bots: migrate to irc.is_channel

This commit is contained in:
James Lu 2017-08-30 21:20:19 -07:00
parent 979d5a48f1
commit 36d6581bba
2 changed files with 4 additions and 4 deletions

View File

@ -155,7 +155,7 @@ def _get_channel_pair(irc, source, chanpair, perm=None):
channel = '#' + channel channel = '#' + channel
channel = irc.to_lower(channel) channel = irc.to_lower(channel)
assert utils.isChannel(channel), "Invalid channel name %s." % channel assert irc.is_channel(channel), "Invalid channel name %s." % channel
if network: if network:
ircobj = world.networkobjects.get(network) ircobj = world.networkobjects.get(network)

View File

@ -94,7 +94,7 @@ def joinclient(irc, source, args):
prefixes = channel[:len(channel)-len(real_channel)] prefixes = channel[:len(channel)-len(real_channel)]
joinmodes = ''.join(prefix_to_mode[prefix] for prefix in prefixes) joinmodes = ''.join(prefix_to_mode[prefix] for prefix in prefixes)
if not utils.isChannel(real_channel): if not irc.is_channel(real_channel):
irc.error("Invalid channel name %r." % real_channel) irc.error("Invalid channel name %r." % real_channel)
return return
@ -186,7 +186,7 @@ def part(irc, source, args):
return return
for channel in clist: for channel in clist:
if not utils.isChannel(channel): if not irc.is_channel(channel):
irc.error("Invalid channel name %r." % channel) irc.error("Invalid channel name %r." % channel)
return return
irc.part(u, channel, reason) irc.part(u, channel, reason)
@ -227,7 +227,7 @@ def msg(irc, source, args):
irc.error('No text given.') irc.error('No text given.')
return return
if not utils.isChannel(target): if not irc.is_channel(target):
# Convert nick of the message target to a UID, if the target isn't a channel # Convert nick of the message target to a UID, if the target isn't a channel
real_target = irc.nick_to_uid(target) real_target = irc.nick_to_uid(target)
if real_target is None: # Unknown target user, if target isn't a valid channel name if real_target is None: # Unknown target user, if target isn't a valid channel name