Remove channel from autojoin when BitBot parts it
This commit is contained in:
parent
6d8ac4d10a
commit
06a750edbd
1 changed files with 10 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue