From d64c85b8ca79097c8eeb15d8cc7c983d4cbdd101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jason=20=5B=EC=A0=9C=EC=9D=B4=EC=8A=A8=20=EC=A0=9C?= =?UTF-8?q?=EB=A1=AC=5D?= <20238115+DuckBoss@users.noreply.github.com> Date: Sat, 12 Sep 2020 18:57:27 -0400 Subject: [PATCH] Optimized imports and fixed missing callback --- JJMumbleBot/lib/callbacks.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/JJMumbleBot/lib/callbacks.py b/JJMumbleBot/lib/callbacks.py index 7e6b7f8a..a964aa96 100644 --- a/JJMumbleBot/lib/callbacks.py +++ b/JJMumbleBot/lib/callbacks.py @@ -1,5 +1,7 @@ -from pymumble_py3 import constants from JJMumbleBot.lib.utils.print_utils import dprint +from pymumble_py3.constants import PYMUMBLE_CLBK_USERCREATED, PYMUMBLE_CLBK_CONNECTED, PYMUMBLE_CLBK_SOUNDRECEIVED, \ + PYMUMBLE_CLBK_TEXTMESSAGERECEIVED, PYMUMBLE_CLBK_DISCONNECTED, PYMUMBLE_CLBK_CHANNELUPDATED, \ + PYMUMBLE_CLBK_CHANNELREMOVED, PYMUMBLE_CLBK_CHANNELCREATED, PYMUMBLE_CLBK_USERREMOVED, PYMUMBLE_CLBK_USERUPDATED class Callbacks(dict): @@ -33,15 +35,16 @@ class CoreCallbacks(Callbacks): def __init__(self): super().__init__() self.update({ - constants.PYMUMBLE_CLBK_USERCREATED: [], - constants.PYMUMBLE_CLBK_TEXTMESSAGERECEIVED: [], - constants.PYMUMBLE_CLBK_SOUNDRECEIVED: [], - constants.PYMUMBLE_CLBK_CONNECTED: [], - constants.PYMUMBLE_CLBK_CHANNELCREATED: [], - constants.PYMUMBLE_CLBK_CHANNELREMOVED: [], - constants.PYMUMBLE_CLBK_CHANNELUPDATED: [], - constants.PYMUMBLE_CLBK_USERREMOVED: [], - constants.PYMUMBLE_CLBK_DISCONNECTED: [] + PYMUMBLE_CLBK_USERCREATED: [], + PYMUMBLE_CLBK_TEXTMESSAGERECEIVED: [], + PYMUMBLE_CLBK_SOUNDRECEIVED: [], + PYMUMBLE_CLBK_CONNECTED: [], + PYMUMBLE_CLBK_CHANNELCREATED: [], + PYMUMBLE_CLBK_CHANNELREMOVED: [], + PYMUMBLE_CLBK_CHANNELUPDATED: [], + PYMUMBLE_CLBK_USERREMOVED: [], + PYMUMBLE_CLBK_USERUPDATED: [], + PYMUMBLE_CLBK_DISCONNECTED: [] }) def register_callback(self, callback, dest: list):