mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-20 07:20:59 +01:00
automode: remove repeated "Error:" in error messages
This commit is contained in:
parent
6a90401d56
commit
605d242677
@ -231,7 +231,7 @@ def delacc(irc, source, args):
|
|||||||
dbentry = db.get(ircobj.name+channel)
|
dbentry = db.get(ircobj.name+channel)
|
||||||
|
|
||||||
if dbentry is None:
|
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
|
return
|
||||||
|
|
||||||
if mask in dbentry:
|
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)
|
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))
|
reply(irc, "Done. Removed the Automode access entry for \x02%s\x02 in \x02%s\x02." % (mask, channel))
|
||||||
else:
|
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.
|
# Remove channels if no more entries are left.
|
||||||
if not dbentry:
|
if not dbentry:
|
||||||
@ -257,14 +257,14 @@ def listacc(irc, source, args):
|
|||||||
try:
|
try:
|
||||||
chanpair = args[0]
|
chanpair = args[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
error(irc, "Error: Invalid arguments given. Needs 1: channel.")
|
error(irc, "Invalid arguments given. Needs 1: channel.")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
ircobj, channel = getChannelPair(irc, source, chanpair, perm='list')
|
ircobj, channel = getChannelPair(irc, source, chanpair, perm='list')
|
||||||
|
|
||||||
dbentry = db.get(ircobj.name+channel)
|
dbentry = db.get(ircobj.name+channel)
|
||||||
if not dbentry:
|
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
|
return
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -297,7 +297,7 @@ def syncacc(irc, source, args):
|
|||||||
try:
|
try:
|
||||||
chanpair = args[0]
|
chanpair = args[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
error(irc, "Error: Invalid arguments given. Needs 1: channel.")
|
error(irc, "Invalid arguments given. Needs 1: channel.")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
ircobj, channel = getChannelPair(irc, source, chanpair, perm='sync')
|
ircobj, channel = getChannelPair(irc, source, chanpair, perm='sync')
|
||||||
@ -320,7 +320,7 @@ def clearacc(irc, source, args):
|
|||||||
try:
|
try:
|
||||||
chanpair = args[0]
|
chanpair = args[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
error(irc, "Error: Invalid arguments given. Needs 1: channel.")
|
error(irc, "Invalid arguments given. Needs 1: channel.")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
ircobj, channel = getChannelPair(irc, source, chanpair, perm='clear')
|
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)
|
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)
|
reply(irc, "Done. Removed all Automode access entries for \x02%s\x02." % channel)
|
||||||
else:
|
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, 'clearaccess')
|
||||||
modebot.add_cmd(clearacc, 'clear')
|
modebot.add_cmd(clearacc, 'clear')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user