diff --git a/plugins/automode.py b/plugins/automode.py index 1a69c44..6472da3 100644 --- a/plugins/automode.py +++ b/plugins/automode.py @@ -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) 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. - modebot.join(ircobj, channel) + # Join the Automode bot to the channel persistently. + modebot.add_persistent_channel(irc, 'automode', channel) modebot.add_cmd(setacc, aliases=('setaccess', 'set'), featured=True) @@ -265,6 +265,7 @@ def delacc(irc, source, args): if not dbentry: log.debug("Automode: purging empty channel pair %s/%s", ircobj.name, channel) del db[ircobj.name+channel] + modebot.remove_persistent_channel(irc, 'automode', channel) modebot.add_cmd(delacc, aliases=('delaccess', 'del'), featured=True) @@ -344,6 +345,7 @@ def clearacc(irc, source, args): del db[ircobj.name+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) + modebot.remove_persistent_channel(irc, 'automode', channel) else: error(irc, "No Automode access entries exist for \x02%s\x02." % channel)