We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54dcd0a commit 6de1b94Copy full SHA for 6de1b94
1 file changed
plugins/chan_track.py
@@ -83,16 +83,24 @@ def do_caps():
83
def get_chan_data(bot):
84
for conn in bot.connections.values():
85
if conn.connected:
86
+ init_chan_data(conn, False)
87
update_conn_data(conn)
88
89
90
@hook.connect
-def init_chan_data(conn):
91
+def init_chan_data(conn, _clear=True):
92
chan_data = conn.memory.setdefault("chan_data", ChanDict())
- chan_data.clear()
93
-
94
users = conn.memory.setdefault("users", UsersDict())
95
- users.clear()
+
+ if not (isinstance(chan_data, ChanDict) and isinstance(users, UsersDict)):
96
+ del conn.memory["chan_data"]
97
+ del conn.memory["users"]
98
99
+ return init_chan_data(conn, _clear)
100
101
+ if _clear:
102
+ chan_data.clear()
103
+ users.clear()
104
105
106
def add_user_membership(user, chan, membership):
0 commit comments