@@ -15,8 +15,6 @@ def load_config():
15
15
vcbot_api = {"send_msg" : send_msgs ,"exception" : vcbot_plugin_DoNotContinue ,"ban_uid" :ignore .ban_uid }
16
16
config .loadroomcfg ()
17
17
vcbot_api ["roomcfg" ]= config .roomcfg
18
- botuid = user .get_self_uid (user .c )
19
- vcbot_api ["bot_uid" ]= botuid
20
18
def load_plugin ():
21
19
for file in os .listdir ("plugins" ):
22
20
if file .endswith (".py" ) and file != "__init__.py" :
@@ -35,7 +33,6 @@ async def plugins_event(event:str): # event:all
35
33
module = importlib .import_module (f"plugins.{ file [:- 3 ]} " )
36
34
module .api = vcbot_api .copy ()
37
35
threading .Thread (target = module .events , args = (event ,)).start ()
38
- threading .Thread (target = schedule .events , args = (event ,)).join ()
39
36
except AttributeError :
40
37
pass
41
38
except vcbot_plugin_DoNotContinue :
@@ -47,7 +44,6 @@ async def plugins_event(event:str): # event:all
47
44
if not skip :
48
45
inital_command .api = vcbot_api .copy ()
49
46
threading .Thread (target = inital_command .events , args = (event ,)).start ()
50
- threading .Thread (target = schedule .events , args = (event ,)).join ()
51
47
return
52
48
53
49
def send_msgs (text :str ):
@@ -79,8 +75,10 @@ def __init__(self,msg:str=None):
79
75
logger .info ("Starting..." )
80
76
today = datetime .date .today ()
81
77
logger .add (f"logs/log-{ today } .log" ,rotation = "1 day" ,encoding = "utf-8" ,format = "{time} {level}-{function} {message}" )
82
- user .user_login ()
83
78
load_config ()
79
+ user .user_login ()
80
+ botuid = user .get_self_uid (user .c )
81
+ vcbot_api ["bot_uid" ]= botuid
84
82
live .set (config .room ,user .c )
85
83
load_plugin ()
86
84
threading .Thread (target = schedule .start ).start ()
0 commit comments