Skip to content

Commit 8700926

Browse files
committed
fix
1 parent 8348e3a commit 8700926

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

main.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ def load_config():
1515
vcbot_api={"send_msg": send_msgs ,"exception": vcbot_plugin_DoNotContinue,"ban_uid":ignore.ban_uid}
1616
config.loadroomcfg()
1717
vcbot_api["roomcfg"]=config.roomcfg
18-
botuid=user.get_self_uid(user.c)
19-
vcbot_api["bot_uid"]=botuid
2018
def load_plugin():
2119
for file in os.listdir("plugins"):
2220
if file.endswith(".py") and file!="__init__.py":
@@ -35,7 +33,6 @@ async def plugins_event(event:str): # event:all
3533
module = importlib.import_module(f"plugins.{file[:-3]}")
3634
module.api=vcbot_api.copy()
3735
threading.Thread(target=module.events, args=(event,)).start()
38-
threading.Thread(target=schedule.events, args=(event,)).join()
3936
except AttributeError:
4037
pass
4138
except vcbot_plugin_DoNotContinue:
@@ -47,7 +44,6 @@ async def plugins_event(event:str): # event:all
4744
if not skip:
4845
inital_command.api=vcbot_api.copy()
4946
threading.Thread(target=inital_command.events, args=(event,)).start()
50-
threading.Thread(target=schedule.events, args=(event,)).join()
5147
return
5248

5349
def send_msgs(text:str):
@@ -79,8 +75,10 @@ def __init__(self,msg:str=None):
7975
logger.info("Starting...")
8076
today=datetime.date.today()
8177
logger.add(f"logs/log-{today}.log",rotation="1 day",encoding="utf-8",format="{time} {level}-{function} {message}")
82-
user.user_login()
8378
load_config()
79+
user.user_login()
80+
botuid=user.get_self_uid(user.c)
81+
vcbot_api["bot_uid"]=botuid
8482
live.set(config.room,user.c)
8583
load_plugin()
8684
threading.Thread(target=schedule.start).start()

0 commit comments

Comments
 (0)