mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 03:29:28 +01:00
automode: add/remove persistent channels on set/del/clearacc
This commit is contained in:
parent
8aa67b93fa
commit
5a0cb9a4ff
@ -230,8 +230,8 @@ def setacc(irc, source, args):
|
|||||||
log.info('(%s) %s set modes +%s for %s on %s', ircobj.name, irc.get_hostmask(source), modes, mask, channel)
|
log.info('(%s) %s set modes +%s for %s on %s', ircobj.name, irc.get_hostmask(source), modes, mask, channel)
|
||||||
reply(irc, "Done. \x02%s\x02 now has modes \x02+%s\x02 in \x02%s\x02." % (mask, modes, channel))
|
reply(irc, "Done. \x02%s\x02 now has modes \x02+%s\x02 in \x02%s\x02." % (mask, modes, channel))
|
||||||
|
|
||||||
# Join the Automode bot to the channel if not explicitly told to.
|
# Join the Automode bot to the channel persistently.
|
||||||
modebot.join(ircobj, channel)
|
modebot.add_persistent_channel(irc, 'automode', channel)
|
||||||
|
|
||||||
modebot.add_cmd(setacc, aliases=('setaccess', 'set'), featured=True)
|
modebot.add_cmd(setacc, aliases=('setaccess', 'set'), featured=True)
|
||||||
|
|
||||||
@ -265,6 +265,7 @@ def delacc(irc, source, args):
|
|||||||
if not dbentry:
|
if not dbentry:
|
||||||
log.debug("Automode: purging empty channel pair %s/%s", ircobj.name, channel)
|
log.debug("Automode: purging empty channel pair %s/%s", ircobj.name, channel)
|
||||||
del db[ircobj.name+channel]
|
del db[ircobj.name+channel]
|
||||||
|
modebot.remove_persistent_channel(irc, 'automode', channel)
|
||||||
|
|
||||||
modebot.add_cmd(delacc, aliases=('delaccess', 'del'), featured=True)
|
modebot.add_cmd(delacc, aliases=('delaccess', 'del'), featured=True)
|
||||||
|
|
||||||
@ -344,6 +345,7 @@ def clearacc(irc, source, args):
|
|||||||
del db[ircobj.name+channel]
|
del db[ircobj.name+channel]
|
||||||
log.info('(%s) %s cleared modes on %s', ircobj.name, irc.get_hostmask(source), channel)
|
log.info('(%s) %s cleared modes on %s', ircobj.name, irc.get_hostmask(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)
|
||||||
|
modebot.remove_persistent_channel(irc, 'automode', channel)
|
||||||
else:
|
else:
|
||||||
error(irc, "No Automode access entries exist for \x02%s\x02." % channel)
|
error(irc, "No Automode access entries exist for \x02%s\x02." % channel)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user