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

automode: remove repeated "Error:" in error messages

This commit is contained in:
James Lu 2017-01-02 10:11:55 -08:00
parent 6a90401d56
commit 605d242677

View File

@ -231,7 +231,7 @@ def delacc(irc, source, args):
dbentry = db.get(ircobj.name+channel)
if dbentry is None:
error(irc, "Error: no Automode access entries exist for \x02%s\x02." % channel)
error(irc, "No Automode access entries exist for \x02%s\x02." % channel)
return
if mask in dbentry:
@ -239,7 +239,7 @@ def delacc(irc, source, args):
log.info('(%s) %s removed modes for %s on %s', ircobj.name, irc.getHostmask(source), mask, channel)
reply(irc, "Done. Removed the Automode access entry for \x02%s\x02 in \x02%s\x02." % (mask, channel))
else:
error(irc, "Error: No Automode access entry for \x02%s\x02 exists in \x02%s\x02." % (mask, channel))
error(irc, "No Automode access entry for \x02%s\x02 exists in \x02%s\x02." % (mask, channel))
# Remove channels if no more entries are left.
if not dbentry:
@ -257,14 +257,14 @@ def listacc(irc, source, args):
try:
chanpair = args[0]
except IndexError:
error(irc, "Error: Invalid arguments given. Needs 1: channel.")
error(irc, "Invalid arguments given. Needs 1: channel.")
return
else:
ircobj, channel = getChannelPair(irc, source, chanpair, perm='list')
dbentry = db.get(ircobj.name+channel)
if not dbentry:
error(irc, "Error: No Automode access entries exist for \x02%s\x02." % channel)
error(irc, "No Automode access entries exist for \x02%s\x02." % channel)
return
else:
@ -297,7 +297,7 @@ def syncacc(irc, source, args):
try:
chanpair = args[0]
except IndexError:
error(irc, "Error: Invalid arguments given. Needs 1: channel.")
error(irc, "Invalid arguments given. Needs 1: channel.")
return
else:
ircobj, channel = getChannelPair(irc, source, chanpair, perm='sync')
@ -320,7 +320,7 @@ def clearacc(irc, source, args):
try:
chanpair = args[0]
except IndexError:
error(irc, "Error: Invalid arguments given. Needs 1: channel.")
error(irc, "Invalid arguments given. Needs 1: channel.")
return
else:
ircobj, channel = getChannelPair(irc, source, chanpair, perm='clear')
@ -330,7 +330,7 @@ def clearacc(irc, source, args):
log.info('(%s) %s cleared modes on %s', ircobj.name, irc.getHostmask(source), channel)
reply(irc, "Done. Removed all Automode access entries for \x02%s\x02." % channel)
else:
error(irc, "Error: No Automode access entries exist for \x02%s\x02." % channel)
error(irc, "No Automode access entries exist for \x02%s\x02." % channel)
modebot.add_cmd(clearacc, 'clearaccess')
modebot.add_cmd(clearacc, 'clear')