Remove channel from autojoin when BitBot parts it

This commit is contained in:
jesopo 2018-09-03 12:22:06 +01:00
parent 6d8ac4d10a
commit 06a750edbd

View file

@ -30,8 +30,14 @@ class Module(object):
channels.append(event["channel"].name)
event["server"].set_setting("autojoin", channels)
def on_kick(self, event):
channels = event["server"].get_setting("autojoin", [])
if event["channel"].name in channels:
channels.remove(event["channel"].name)
def _remove_channel(self, server, channel_name):
channels = server.get_setting("autojoin", [])
if channel_name in channels:
channes.remove(channel_name)
event["server"].set_setting("autojoin", channels)
def self_part(self, event):
self._remove_channel(event["server"], event["channel"].name)
def on_kick(self, event):
self._remove_channel(event["server"], event["channel"].name)