plugin-manager icon indicating copy to clipboard operation
plugin-manager copied to clipboard

npm ls -s 消息过长

Open RSXQAQ opened this issue 2 years ago • 8 comments

RSXQAQ avatar Dec 22 '22 14:12 RSXQAQ

请提供报错的完整 log

j1g5awi avatar Dec 23 '22 02:12 j1g5awi

请提供报错的完整 log

NKKSLMFKUYLF%5X(5I2LE

RSXQAQ avatar Dec 23 '22 02:12 RSXQAQ

疑似 gocq 报错,看下 gocq 对应 log

j1g5awi avatar Dec 23 '22 03:12 j1g5awi

疑似 gocq 报错,看下 gocq 对应 log

[2022-12-23 11:33:22] [WARNING]: 群消息发送失败: 账号可能被风控. 6

RSXQAQ avatar Dec 23 '22 03:12 RSXQAQ

消息过长以致于 gocq 发不出来,等我改下 npm ls 的分页吧。

j1g5awi avatar Dec 23 '22 03:12 j1g5awi

我也遇到这个问题了,具体就是某些插件会建立副插件作为依赖库进行调用,导致这些副插件也会被检测到,在发送npm ls之后这些副插件数量过多导致发送的消息超出了qq一条消息的字数,解决办法是构造json发送合并转发消息

yhzcake avatar Jan 06 '23 06:01 yhzcake

`01-06 19:26:22 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_manager) failed. Traceback (most recent call last):

File "", line 1, in

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) │ │ └ 324 │ └ 3 └ <function _main at 0x0000021E54158790>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 129, in _main return self._bootstrap(parent_sentinel) │ │ └ 324 │ └ <function BaseProcess._bootstrap at 0x0000021E540931C0> └ <SpawnProcess name='SpawnProcess-1' parent=176148 started>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap self.run() │ └ <function BaseProcess.run at 0x0000021E54092830> └ <SpawnProcess name='SpawnProcess-1' parent=176148 started>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {'config': <uvicorn.config.Config object at 0x0000021E53E5FD00>, 'target': <bound method Server.run of <uvicorn.server.Server... │ │ │ │ └ <SpawnProcess name='SpawnProcess-1' parent=176148 started> │ │ │ └ () │ │ └ <SpawnProcess name='SpawnProcess-1' parent=176148 started> │ └ <function subprocess_started at 0x0000021E56572320> └ <SpawnProcess name='SpawnProcess-1' parent=176148 started>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) │ └ [<socket.socket fd=320, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8080)>] └ <bound method Server.run of <uvicorn.server.Server object at 0x0000021E5411C040>>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) │ │ │ │ └ [<socket.socket fd=320, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8080)>] │ │ │ └ <function Server.serve at 0x0000021E5654AE60> │ │ └ <uvicorn.server.Server object at 0x0000021E5411C040> │ └ <function run at 0x0000021E55D52950> └ <module 'asyncio' from 'C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\asyncio\init.py'>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) │ │ └ <coroutine object Server.serve at 0x0000021E57807A00> │ └ <function BaseEventLoop.run_until_complete at 0x0000021E55D50CA0> └ <_WindowsSelectorEventLoop running=True closed=False debug=False>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete self.run_forever() │ └ <function BaseEventLoop.run_forever at 0x0000021E55D50C10> └ <_WindowsSelectorEventLoop running=True closed=False debug=False>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever self._run_once() │ └ <function BaseEventLoop._run_once at 0x0000021E55D52710> └ <_WindowsSelectorEventLoop running=True closed=False debug=False>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once handle._run() │ └ <function Handle._run at 0x0000021E55CA1900> └ <Handle Task.task_wakeup(<_GatheringFu...result=[None]>)>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) │ │ │ │ │ └ <member '_args' of 'Handle' objects> │ │ │ │ └ <Handle Task.task_wakeup(<_GatheringFu...result=[None]>)> │ │ │ └ <member '_callback' of 'Handle' objects> │ │ └ <Handle Task.task_wakeup(<_GatheringFu...result=[None]>)> │ └ <member '_context' of 'Handle' objects> └ <Handle Task.task_wakeup(<_GatheringFu...result=[None]>)>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _command at 0x0000021E577D05E0>: <Task finished name='Task-4801' coro=<_command() done, defined at C:\Users\yhz_ca... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x0000021E655F2050> │ │ │ │ └ {'_prefix': {'command': ('npm',), 'raw_command': '*npm', 'command_arg': [MessageSegment(type='text', data={'text': 'ls'})], '... │ │ │ └ GroupMessageEvent(time=1673004411, self_id=3580818212, post_type='message', sub_type='normal', user_id=1367808860, message_ty... │ │ └ Bot(type='OneBot V11', self_id='3580818212') │ └ Matcher(type='message', module=nonebot_plugin_manager) └ <function _run_matcher at 0x0000021E57BB04C0>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 186, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _command at 0x0000021E577D05E0>: <Task finished name='Task-4801' coro=<_command() done, defined at C:\Users\yhz_ca... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x0000021E655F2050> │ │ │ │ └ {'_prefix': {'command': ('npm',), 'raw_command': '*npm', 'command_arg': [MessageSegment(type='text', data={'text': 'ls'})], '... │ │ │ └ GroupMessageEvent(time=1673004411, self_id=3580818212, post_type='message', sub_type='normal', user_id=1367808860, message_ty... │ │ └ Bot(type='OneBot V11', self_id='3580818212') │ └ <function Matcher.run at 0x0000021E577D00D0> └ Matcher(type='message', module=nonebot_plugin_manager)

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher.py", line 716, in run await self.simple_run(bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _command at 0x0000021E577D05E0>: <Task finished name='Task-4801' coro=<_command() done, defined at C:\Users\yhz_ca... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x0000021E655F2050> │ │ │ │ └ {'_prefix': {'command': ('npm',), 'raw_command': '*npm', 'command_arg': [MessageSegment(type='text', data={'text': 'ls'})], '... │ │ │ └ GroupMessageEvent(time=1673004411, self_id=3580818212, post_type='message', sub_type='normal', user_id=1367808860, message_ty... │ │ └ Bot(type='OneBot V11', self_id='3580818212') │ └ <function Matcher.simple_run at 0x0000021E577D0040> └ Matcher(type='message', module=nonebot_plugin_manager)

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher.py", line 688, in simple_run await handler( └ Dependent(call=_)

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\dependencies_init_.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) │ │ │ │ │ │ └ {'bot': Bot(type='OneBot V11', self_id='3580818212'), 'event': GroupMessageEvent(time=1673004411, self_id=3580818212, post_ty... │ │ │ │ │ └ <function _ at 0x0000021E6273D510> │ │ │ │ └ Dependent(call=_) │ │ │ └ ~R │ │ └ typing.Awaitable │ └ typing.Callable └ <function cast at 0x0000021E55D1C5E0>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_manager_init_.py", line 64, in _ await bot.send(event, "\n".join(message[:30]) + f"\n【第{i}页】") │ │ │ └ ['群 962301758 的插件列表:', '[o] echo', '[o] genshinuid_abyss', '[o] genshinuid_adv', '[o] genshinuid_check', '[o] genshinuid_coll... │ │ └ GroupMessageEvent(time=1673004411, self_id=3580818212, post_type='message', sub_type='normal', user_id=1367808860, message_ty... │ └ <function Bot.send at 0x0000021E57BB0940> └ Bot(type='OneBot V11', self_id='3580818212')

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 220, in send return await self.class.send_handler(self, event, message, **kwargs) │ │ │ │ │ └ {} │ │ │ │ └ '群 962301758 的插件列表:\n[o] echo\n[o] genshinuid_abyss\n[o] genshinuid_adv\n[o] genshinuid_check\n[o] genshinuid_collection\n[o]... │ │ │ └ GroupMessageEvent(time=1673004411, self_id=3580818212, post_type='message', sub_type='normal', user_id=1367808860, message_ty... │ │ └ Bot(type='OneBot V11', self_id='3580818212') │ └ <attribute 'class' of 'object' objects> └ Bot(type='OneBot V11', self_id='3580818212')

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 175, in send return await bot.send_msg(**params) │ └ {'user_id': 1367808860, 'group_id': 962301758, 'message_type': 'group', 'message': [MessageSegment(type='text', data={'text':... └ Bot(type='OneBot V11', self_id='3580818212')

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\adapter\bot.py", line 116, in call_api raise exception └ <ActionFailed data=None, echo='1', msg='SEND_MSG_API_ERROR', retcode=100, status='failed', wording='send group message failed...

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\adapter\bot.py", line 94, in call_api result = await self.adapter._call_api(self, api, **data) │ │ │ │ │ └ {'user_id': 1367808860, 'group_id': 962301758, 'message_type': 'group', 'message': [MessageSegment(type='text', data={'text':... │ │ │ │ └ 'send_msg' │ │ │ └ Bot(type='OneBot V11', self_id='3580818212') │ │ └ <function Adapter._call_api at 0x0000021E57BB1630> │ └ Adapter(name='OneBot V11') └ Bot(type='OneBot V11', self_id='3580818212')

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 132, in _call_api return handle_api_result( └ <function handle_api_result at 0x0000021E57B3C670>

File "C:\Users\yhz_cake\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\adapters\onebot\v11\utils.py", line 58, in handle_api_result raise ActionFailed(**result) │ └ {'data': None, 'echo': '1', 'msg': 'SEND_MSG_API_ERROR', 'retcode': 100, 'status': 'failed', 'wording': 'send group message f... └ <class 'nonebot.adapters.onebot.v11.exception.ActionFailed'>

nonebot.adapters.onebot.v11.exception.ActionFailed: <ActionFailed data=None, echo='1', msg='SEND_MSG_API_ERROR', retcode=100, status='failed', wording='send group message failed: blocked by server'>`

这里是我的gocq报的错,应该也是消息过长导致的吧,不过我更新了最新的插件还是报错了,是只改了-s的消息吗

yhzcake avatar Jan 06 '23 11:01 yhzcake

0.5.14 已修复

j1g5awi avatar Jan 06 '23 13:01 j1g5awi