Skip to content

Commit

Permalink
fix: reload bot manager, close #268
Browse files Browse the repository at this point in the history
  • Loading branch information
lss233 committed Mar 4, 2023
1 parent bfcb959 commit 1493d79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import sys


sys.path.append(os.getcwd())
import constants

Expand Down Expand Up @@ -34,6 +33,7 @@
from conversation import ConversationHandler
from middlewares.ratelimit import MiddlewareRatelimit
from middlewares.timeout import MiddlewareTimeout
from manager.bot import BotManager
from constants import config, botManager
from middlewares.ratelimit import manager as ratelimit_manager
from requests.exceptions import SSLError, ProxyError
Expand Down Expand Up @@ -247,6 +247,7 @@ async def update_rate(app: Ariadne, event: MessageEvent, sender: Union[Friend, M
config.scan_presets()
await app.send_message(event, "配置文件重新载入完毕!")
await app.send_message(event, "重新登录账号中,详情请看控制台日志……")
constants.botManager = BotManager(config)
botManager.login()
await app.send_message(event, "登录结束")
finally:
Expand Down

0 comments on commit 1493d79

Please sign in to comment.