onebot-walle / nonebot_adapter_walleq

Run Walle-Q from nonebot2 without OBC
GNU Affero General Public License v3.0
18 stars 0 forks source link

`nonebot.run()` 后进程异常退出 #1

Closed Well2333 closed 1 year ago

Well2333 commented 1 year ago

Windows 10 22H2 python 3.8.10 nonebot2=2.0.0rc4 nonebot-adapter-walleq=0.1.1

进程在 Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit) 后直接结束了,在移除 Walleq_Adapter 后正常。

bot.py

import nonebot
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter
from nonebot.adapters.onebot.v12 import Adapter as ONEBOT_V12Adapter
from nonebot_adapter_walleq import Adapter as Walleq_Adapter

nonebot.init()

driver = nonebot.get_driver()
driver.register_adapter(ONEBOT_V11Adapter)
driver.register_adapter(ONEBOT_V12Adapter)
driver.register_adapter(Walleq_Adapter)

nonebot.load_plugin("nonebot_plugin_bilichat")

if __name__ == "__main__":
    print("before run")
    nonebot.run()
    print("after run")
04-05 15:07:33 [SUCCESS] nonebot | NoneBot is initializing...
04-05 15:07:33 [INFO] nonebot | Current Env: prod
04-05 15:07:33 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'TRACE', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'walle_q': {'*******': {'protocol': '2', 'password': '********'}}}
04-05 15:07:33 [TRACE] nonebot | Detected driver <class 'nonebot.drivers.fastapi.Driver'> with no mixins.
04-05 15:07:33 [DEBUG] nonebot | Succeeded to load adapter "OneBot V11"
04-05 15:07:33 [DEBUG] nonebot | Succeeded to load adapter "OneBot V12"
04-05 15:07:33 [DEBUG] nonebot | Succeeded to load adapter "Walle-Q"
04-05 15:07:34 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_localstore"
04-05 15:07:34 [DEBUG] nonebot_plugin_bilichat | font: sarasa-mono-sc-semibold.ttf
04-05 15:07:34 [DEBUG] nonebot_plugin_bilichat | Font sarasa-mono-sc-semibold.ttf found in local        
04-05 15:07:34 [DEBUG] nonebot_plugin_bilichat | font: sarasa-mono-sc-bold.ttf
04-05 15:07:34 [DEBUG] nonebot_plugin_bilichat | Font sarasa-mono-sc-bold.ttf found in local
04-05 15:07:34 [DEBUG] nonebot_plugin_bilichat | font: vanfont.ttf
04-05 15:07:34 [DEBUG] nonebot_plugin_bilichat | Font vanfont.ttf found in local
04-05 15:07:34 [TRACE] nonebot | Define new matcher Matcher(type='message', module=nonebot_plugin_bilichat)
04-05 15:07:34 [TRACE] nonebot | Define new matcher Matcher(type='message', module=nonebot_plugin_bilichat)
04-05 15:07:34 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_bilichat"
before run
04-05 15:07:34 [SUCCESS] nonebot | Running NoneBot...
04-05 15:07:34 [DEBUG] nonebot | Loaded adapters: OneBot V11, OneBot V12, Walle-Q
04-05 15:07:34 [INFO] uvicorn | Started server process [19508]
04-05 15:07:34 [INFO] uvicorn | Waiting for application startup.
04-05 15:07:34 [INFO] uvicorn | Application startup complete.
04-05 15:07:34 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
Well2333 commented 1 year ago

也不应该是与其他 Adapter 冲突导致的,以下的代码依旧会导致异常退出。log基本一致就不发了。

import nonebot
from nonebot_adapter_walleq import Adapter as Walleq_Adapter

nonebot.init()

driver = nonebot.get_driver()
driver.register_adapter(Walleq_Adapter)

nonebot.load_plugin("nonebot_plugin_bilichat")

if __name__ == "__main__":
    print("before run")
    nonebot.run()
    print("after run")
Well2333 commented 1 year ago

顺带一提,使用 nonebot_plugin_localstore 谢谢喵

abrahum commented 1 year ago

配置密码登录导致的 rust 部分报错结束进程,将会尽快支持密码登录2333

暂时建议密码留空使用手表协议扫码登录使用