Closed HorizenX1 closed 2 years ago
loop已经运行? 你试试python3.9 run.py来启动,别用nb run
谢谢大佬,报错没了。但是还有一个问题就是机器人收到部分指令后不会回复消息,这个该怎么解决呢?
10-03 10:01:17 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message -1612274322 from 1045925330@[群:443125748] "武器" 10-03 10:01:17 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:01:51 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message -387869192 from 1045925330@[群:443125748] "原神卡池" 10-03 10:01:51 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:02:09 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message 1911080002 from 1045925330@[群:443125748] "相遇之缘" 10-03 10:02:09 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:02:33 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message 116389076 from 1045925330@[群:443125748] "11" 10-03 10:02:33 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:02:39 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message -1773082299 from 1045925330@[群:443125748] "321321321" 10-03 10:02:39 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:02:54 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message -514336301 from 1045925330@[群:443125748] "今日角色天赋材料" 10-03 10:02:54 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:03:04 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message -2121248714 from 1045925330@[群:443125748] "武器材料" 10-03 10:03:04 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:03:30 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message -157851488 from 1045925330@[群:443125748] "原神副本" 10-03 10:03:30 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:03:43 [DEBUG] nonebot | CQHTTP | User is calling me bot 10-03 10:03:43 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message 1872638234 from 1045925330@[群:443125748] "更新原神卡池" 10-03 10:03:43 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:03:52 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message 412680588 from 1045925330@[群:443125748] "更新原神地图" 10-03 10:03:52 [DEBUG] nonebot | Checking for matchers in priority 1... 10-03 10:05:13 [SUCCESS] nonebot | CQHTTP 11801275 | [message.group.normal]: Message -2030201809 from 1045925330@[群:443125748] "原神帮助" 10-03 10:05:13 [DEBUG] nonebot | Checking for matchers in priority 1...
你的机器人设置了全局命令前缀 'command_start': {'/', '.'} 吧 /或者.开头的消息才能触发命令
可以了,谢谢
请问如何解决?
日志: xh1045925330@D1:~/Genshin_Impact_bot/nb$ nb run 10-03 09:11:52 [SUCCESS] nonebot | NoneBot is initializing... 10-03 09:11:52 [INFO] nonebot | Current Env: dev 10-03 09:11:52 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('0.0.0.0'), 'port': 8080, 'debug': True, 'log_level': None, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': {'1045925330'}, 'nickname': {'bot', '派蒙'}, 'command_start': {'.', '/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'dev'} 10-03 09:11:53 [DEBUG] nonebot | Succeeded to load adapter "cqhttp" 10-03 09:11:53 [SUCCESS] nonebot | Succeeded to import "qiu_qiu_translation" 10-03 09:11:53 [SUCCESS] nonebot | Succeeded to import "config" 10-03 09:11:53 [SUCCESS] nonebot | Succeeded to import "help" 10-03 09:11:53 [SUCCESS] nonebot | Succeeded to import "artifact_rate" 10-03 09:11:53 [INFO] query_resource_points | 正在更新资源点数据 10-03 09:11:54 [INFO] query_resource_points | 资源点数据更新完成 10-03 09:11:54 [INFO] query_resource_points | 正在更新地图数据 10-03 09:11:58 [INFO] query_resource_points | 地图数据更新完成 10-03 09:11:58 [SUCCESS] nonebot | Succeeded to import "query_resource_points" 10-03 09:11:58 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_apscheduler" 10-03 09:11:58 [SUCCESS] nonebot | Succeeded to import "material_remind" 10-03 09:11:58 [INFO] gacha | 正在更新卡池数据 10-03 09:11:59 [SUCCESS] nonebot | Succeeded to import "gacha" 10-03 09:11:59 [SUCCESS] nonebot | Succeeded to import "almanac" 10-03 09:11:59 [SUCCESS] nonebot | Succeeded to import "artifact_collect" 10-03 09:11:59 [SUCCESS] nonebot | Running NoneBot... 10-03 09:11:59 [DEBUG] nonebot | Loaded adapters: cqhttp 10-03 09:11:59 [INFO] uvicorn | Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit) 10-03 09:11:59 [INFO] uvicorn | Started reloader process [173] using watchgod 10-03 09:12:00 [SUCCESS] nonebot | NoneBot is initializing... 10-03 09:12:00 [INFO] nonebot | Current Env: dev 10-03 09:12:00 [DEBUG] nonebot | Loaded Config: {'driver': 'nonebot.drivers.fastapi', 'host': IPv4Address('0.0.0.0'), 'port': 8080, 'debug': True, 'log_level': None, 'api_root': {}, 'api_timeout': 30.0, 'access_token': None, 'secret': None, 'superusers': {'1045925330'}, 'nickname': {'派蒙', 'bot'}, 'command_start': {'/', '.'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'dev'} 10-03 09:12:00 [DEBUG] nonebot | Succeeded to load adapter "cqhttp" 10-03 09:12:00 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_apscheduler" 10-03 09:12:00 [SUCCESS] nonebot | Succeeded to import "material_remind" 10-03 09:12:00 [SUCCESS] nonebot | Succeeded to import "config" 10-03 09:12:00 [ERROR] nonebot | Failed to import "gacha" Traceback (most recent call last): File "", line 1, in
File "/usr/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/usr/lib/python3.9/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/xh1045925330/.local/lib/python3.9/site-packages/uvicorn/subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/home/xh1045925330/.local/lib/python3.9/site-packages/uvicorn/server.py", line 50, in run
loop.run_until_complete(self.serve(sockets=sockets))
File "/home/xh1045925330/.local/lib/python3.9/site-packages/uvicorn/server.py", line 57, in serve
config.load()
File "/home/xh1045925330/.local/lib/python3.9/site-packages/uvicorn/config.py", line 318, in load
self.loaded_app = import_from_string(self.app)
File "/home/xh1045925330/.local/lib/python3.9/site-packages/uvicorn/importer.py", line 22, in import_from_string
module = importlib.import_module(module_str)
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "./bot.py", line 30, in
nonebot.load_plugins("Genshin_Impact_bot")
File "/home/xh1045925330/.local/lib/python3.9/site-packages/nonebot/plugin/init.py", line 997, in load_plugins
result = context.run(_load_plugin, manager, plugin_name)