HibiKier / zhenxun_bot

基于 Nonebot2 开发,非常可爱的绪山真寻bot
GNU Affero General Public License v3.0
3.39k stars 602 forks source link

搜番功能报错 #478

Closed Johnwikix closed 2 years ago

Johnwikix commented 2 years ago

05-21 14:23:09 [ERROR] nonebot | Running matcher <Matcher from plugins.search_anime, type=message, priority=5, temp=False> failed. Traceback (most recent call last):

File "bot.py", line 20, in nonebot.run() │ └ <function run at 0x7f8434c14a60> └ <module 'nonebot' from '/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/__in...

File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/init.py", line 258, in run get_driver().run(*args, **kwargs) │ │ └ {} │ └ () └ <function get_driver at 0x7f84364b4ca0> File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/drivers/fastapi.py", line 168, in run uvicorn.run( │ └ <function run at 0x7f843368b280> └ <module 'uvicorn' from '/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/uvicorn/in... File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/uvicorn/main.py", line 463, in run server.run() │ └ <function Server.run at 0x7f843368b430> └ <uvicorn.server.Server object at 0x7f83fdd2c130> File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) │ │ │ │ └ None │ │ │ └ <function Server.serve at 0x7f843368b4c0> │ │ └ <uvicorn.server.Server object at 0x7f83fdd2c130> │ └ <function run at 0x7f8435d4edc0> └ <module 'asyncio' from '/usr/lib/python3.8/asyncio/init__.py'> File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) │ │ └ <coroutine object Server.serve at 0x7f83fdcca1c0> │ └ <method 'run_until_complete' of 'uvloop.loop.Loop' objects> └ File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/message.py", line 153, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _event_to_me at 0x7f8434bb8dc0>: <Task finished name='Task-247112' coro=<_event_to_me() done, defined at /root/.ca... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x7f83faa0d1c0> │ │ │ │ └ {'_prefix': {'command': ('搜番',), 'raw_command': '搜番', 'command_arg': [MessageSegment(type='text', data={'text': 'ウチの弟マジでデカイんだ... │ │ │ └ PrivateMessageEvent(time=1653114168, self_id=1573096463, post_type='message', sub_type='friend', user_id=906877194, message_t... │ │ └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f83fb1b5850> │ └ <Matcher from plugins.search_anime, type=message, priority=5, temp=False> └ <function _run_matcher at 0x7f8434aabdc0>

File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/message.py", line 202, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _event_to_me at 0x7f8434bb8dc0>: <Task finished name='Task-247112' coro=<_event_to_me() done, defined at /root/.ca... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x7f83faa0d1c0> │ │ │ │ └ {'_prefix': {'command': ('搜番',), 'raw_command': '搜番', 'command_arg': [MessageSegment(type='text', data={'text': 'ウチの弟マジでデカイんだ... │ │ │ └ PrivateMessageEvent(time=1653114168, self_id=1573096463, post_type='message', sub_type='friend', user_id=906877194, message_t... │ │ └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f83fb1b5850> │ └ <function Matcher.run at 0x7f8434bb8a60> └ <Matcher from plugins.search_anime, type=message, priority=5, temp=False> File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _event_to_me at 0x7f8434bb8dc0>: <Task finished name='Task-247112' coro=<_event_to_me() done, defined at /root/.ca... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x7f83faa0d1c0> │ │ │ │ └ {'_prefix': {'command': ('搜番',), 'raw_command': '搜番', 'command_arg': [MessageSegment(type='text', data={'text': 'ウチの弟マジでデカイんだ... │ │ │ └ PrivateMessageEvent(time=1653114168, self_id=1573096463, post_type='message', sub_type='friend', user_id=906877194, message_t... │ │ └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f83fb1b5850> │ └ <function Matcher.simple_run at 0x7f8434bb89d0> └ <Matcher from plugins.search_anime, type=message, priority=5, temp=False> File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/internal/matcher.py", line 635, in simplerun await handler( └ <Dependent call=<function at 0x7f83fdda2b80>, params=[ModelField(name='bot', type=Bot, required=True), ModelField(name='eve... File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-WllApE-o-py3.8/lib/python3.8/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(**values) │ │ └ {'bot': <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f83fb1b5850>, 'event': PrivateMessageEvent(time=1653114168, selfid... │ └ <function at 0x7f83fdda2b80> └ <Dependent call=<function _ at 0x7f83fdda2b80>, params=[ModelField(name='bot', type=Bot, required=True), ModelField(name='eve...

File "/home/zhenxun/zhenxun_bot-0.1.5.3/plugins/searchanime/init.py", line 47, in anime_report = await from_anime_get_info( └ <function from_anime_get_info at 0x7f83fde04af0>

File "/home/zhenxun/zhenxun_bot-0.1.5.3/plugins/search_anime/data_source.py", line 18, in from_anime_get_info repass.insert(0, f"搜索 {key_word} 结果(耗时 {int(time.time() - s_time)} 秒):\n") └ ''

AttributeError: 'str' object has no attribute 'insert'

MingxuanGame commented 2 years ago

230