CMHopeSunshine / LittlePaimon

小派蒙!基于Nonebot2的原神机器人,包括但不限于UID面板查询、抽卡记录分析、游戏攻略图鉴、实时便签、原石札记、群聊学习、群管等功能。/ LittlePamon! Genshin Impact multifunctional bot based on Nonebot2.
https://docs.paimon.cherishmoon.top
GNU Affero General Public License v3.0
1.15k stars 127 forks source link

来点XX 图报错 #134

Closed wayne0926 closed 2 years ago

wayne0926 commented 2 years ago

go-cqhttp的输出,试了多次不同类型图片也是这样

07-23 15:04:05 [ERROR] nonebot | Running matcher <Matcher from LittlePaimon.Paimon_Plugins.random_img, type=message, priority=13, temp=False> failed.
Traceback (most recent call last):

  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/bin/nb", line 8, in <module>
    sys.exit(main())
    │   │    └ <ClickAliasedGroup main>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0x7f1a4ed85820>
           └ <ClickAliasedGroup main>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         │    │      └ <click.core.Context object at 0x7f1a4f050400>
         │    └ <function MultiCommand.invoke at 0x7f1a4ed08820>
         └ <ClickAliasedGroup main>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
           │               │       │       │      └ <click.core.Context object at 0x7f1a4f050eb0>
           │               │       │       └ <function Command.invoke at 0x7f1a4ed08310>
           │               │       └ <ClickAliasedCommand run>
           │               └ <click.core.Context object at 0x7f1a4f050eb0>
           └ <function MultiCommand.invoke.<locals>._process_result at 0x7f1a4f14c040>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           │   │      │    │           │   └ {'file': 'bot.py', 'app': 'app'}
           │   │      │    │           └ <click.core.Context object at 0x7f1a4f050eb0>
           │   │      │    └ <function run at 0x7f1a4bf3fb80>
           │   │      └ <ClickAliasedCommand run>
           │   └ <function Context.invoke at 0x7f1a4ed850d0>
           └ <click.core.Context object at 0x7f1a4f050eb0>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
                       │       └ {'file': 'bot.py', 'app': 'app'}
                       └ ()
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nb_cli/commands/main.py", line 30, in run
    run_bot(file, app)
    │       │     └ 'app'
    │       └ 'bot.py'
    └ <function run_bot at 0x7f1a4bf31a60>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nb_cli/handlers/deploy.py", line 25, in run_bot
    nonebot.run(app=f"{module_name}:{app}")
    │       └ <function run at 0x7f1a4cf03ee0>
    └ <module 'nonebot' from '/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/__i...
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/__init__.py", line 261, in run
    get_driver().run(*args, **kwargs)
    │                 │       └ {'app': 'bot:app'}
    │                 └ ()
    └ <function get_driver at 0x7f1a4dcc9310>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 170, in run
    uvicorn.run(
    │       └ <function run at 0x7f1a4b85ce50>
    └ <module 'uvicorn' from '/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/uvicorn/__i...
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run
    server.run()
    │      └ <function Server.run at 0x7f1a4b868040>
    └ <uvicorn.server.Server object at 0x7f1a329a96a0>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x7f1a4b8680d0>
           │       │   └ <uvicorn.server.Server object at 0x7f1a329a96a0>
           │       └ <function run at 0x7f1a4e596d30>
           └ <module 'asyncio' from '/usr/local/lib/python3.9/asyncio/__init__.py'>
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
           │    │                  └ <coroutine object Server.serve at 0x7f1a329d5bc0>
           │    └ <method 'run_until_complete' of 'uvloop.loop.Loop' objects>
           └ <uvloop.Loop running=True closed=False debug=False>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 146, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
          │            │        │    │      │      │      └ {<function _command at 0x7f1a4cea9820>: <Task finished name='Task-154163' coro=<_command() done, defined at /root/.cache/pypo...
          │            │        │    │      │      └ <contextlib.AsyncExitStack object at 0x7f1a2c06ba60>
          │            │        │    │      └ {'_prefix': {'command': ('来点原神图',), 'raw_command': '来点原神图', 'command_arg': [], 'command_start': ''}}
          │            │        │    └ PrivateMessageEvent(time=1658603044, self_id=1277352069, post_type='message', sub_type='friend', user_id=2018405152, message_...
          │            │        └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
          │            └ <Matcher from LittlePaimon.Paimon_Plugins.random_img, type=message, priority=13, temp=False>
          └ <function _run_matcher at 0x7f1a4be67670>
> File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 196, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
          │       │   │    │      │      │      └ {<function _command at 0x7f1a4cea9820>: <Task finished name='Task-154163' coro=<_command() done, defined at /root/.cache/pypo...
          │       │   │    │      │      └ <contextlib.AsyncExitStack object at 0x7f1a2c06ba60>
          │       │   │    │      └ {'_prefix': {'command': ('来点原神图',), 'raw_command': '来点原神图', 'command_arg': [], 'command_start': ''}}
          │       │   │    └ PrivateMessageEvent(time=1658603044, self_id=1277352069, post_type='message', sub_type='friend', user_id=2018405152, message_...
          │       │   └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
          │       └ <function Matcher.run at 0x7f1a4cea93a0>
          └ <Matcher from LittlePaimon.Paimon_Plugins.random_img, type=message, priority=13, temp=False>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 668, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
          │    │          │    │      │      │      └ {<function _command at 0x7f1a4cea9820>: <Task finished name='Task-154163' coro=<_command() done, defined at /root/.cache/pypo...
          │    │          │    │      │      └ <contextlib.AsyncExitStack object at 0x7f1a2c06ba60>
          │    │          │    │      └ {'_prefix': {'command': ('来点原神图',), 'raw_command': '来点原神图', 'command_arg': [], 'command_start': ''}}
          │    │          │    └ PrivateMessageEvent(time=1658603044, self_id=1277352069, post_type='message', sub_type='friend', user_id=2018405152, message_...
          │    │          └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
          │    └ <function Matcher.simple_run at 0x7f1a4cea9310>
          └ <Matcher from LittlePaimon.Paimon_Plugins.random_img, type=message, priority=13, temp=False>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 635, in simple_run
    await handler(
          └ <Dependent call=<function ys_img_handler at 0x7f1a4803e280>, params=[ModelField(name='event', type=MessageEvent, required=Tru...
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/dependencies/__init__.py", line 92, in __call__
    return await self.call(**values)
                 │    │      └ {'event': PrivateMessageEvent(time=1658603044, self_id=1277352069, post_type='message', sub_type='friend', user_id=2018405152...
                 │    └ <function ys_img_handler at 0x7f1a4803e280>
                 └ <Dependent call=<function ys_img_handler at 0x7f1a4803e280>, params=[ModelField(name='event', type=MessageEvent, required=Tru...

  File "/www/wwwroot/paimeng/./LittlePaimon/utils/decorator.py", line 24, in wrapped
    raise e

  File "/www/wwwroot/paimeng/./LittlePaimon/utils/decorator.py", line 19, in wrapped
    message_id = await func(**kwargs)
                       │      └ {'event': PrivateMessageEvent(time=1658603044, self_id=1277352069, post_type='message', sub_type='friend', user_id=2018405152...
                       └ <function ys_img_handler at 0x7f1a4803e790>

  File "/www/wwwroot/paimeng/./LittlePaimon/Paimon_Plugins/random_img.py", line 102, in ys_img_handler
    await ys_img.finish(MessageSegment.image(file=random.choice(urls)))
          │      │      │              │          │      │      └ ['https://api.dujin.org/img/yuanshen/', 'https://api.dreamofice.cn/random-v0/img.php?game=ys']
          │      │      │              │          │      └ <bound method Random.choice of <random.Random object at 0x5563301b33c0>>
          │      │      │              │          └ <module 'random' from '/usr/local/lib/python3.9/random.py'>
          │      │      │              └ <staticmethod object at 0x7f1a4bef4880>
          │      │      └ <class 'nonebot.adapters.onebot.v11.message.MessageSegment'>
          │      └ <classmethod object at 0x7f1a4cea80d0>
          └ <Matcher from LittlePaimon.Paimon_Plugins.random_img, type=message, priority=13, temp=False>

  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 464, in finish
    await cls.send(message, **kwargs)
          │   │    │          └ {}
          │   │    └ MessageSegment(type='image', data={'file': 'https://api.dujin.org/img/yuanshen/', 'type': None, 'cache': 'true', 'proxy': 'tr...
          │   └ <classmethod object at 0x7f1a4cea80a0>
          └ <Matcher from LittlePaimon.Paimon_Plugins.random_img, type=message, priority=13, temp=False>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 449, in send
    return await bot.send(event=event, message=_message, **kwargs)
                 │   │          │              │           └ {}
                 │   │          │              └ MessageSegment(type='image', data={'file': 'https://api.dujin.org/img/yuanshen/', 'type': None, 'cache': 'true', 'proxy': 'tr...
                 │   │          └ PrivateMessageEvent(time=1658603044, self_id=1277352069, post_type='message', sub_type='friend', user_id=2018405152, message_...
                 │   └ <function Bot.send at 0x7f1a4be67af0>
                 └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 220, in send
    return await self.__class__.send_handler(self, event, message, **kwargs)
                 │    │                      │     │      │          └ {}
                 │    │                      │     │      └ MessageSegment(type='image', data={'file': 'https://api.dujin.org/img/yuanshen/', 'type': None, 'cache': 'true', 'proxy': 'tr...
                 │    │                      │     └ PrivateMessageEvent(time=1658603044, self_id=1277352069, post_type='message', sub_type='friend', user_id=2018405152, message_...
                 │    │                      └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
                 │    └ <attribute '__class__' of 'object' objects>
                 └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/bot.py", line 175, in send
    return await bot.send_msg(**params)
                 │              └ {'user_id': 2018405152, 'message_type': 'private', 'message': [MessageSegment(type='image', data={'file': 'https://api.dujin....
                 └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 117, in call_api
    raise exception
          └ <ActionFailed data=None, echo=23, msg=SEND_MSG_API_ERROR, retcode=100, status=failed, wording=请参考 go-cqhttp 端输出>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/internal/adapter/bot.py", line 94, in call_api
    result = await self.adapter._call_api(self, api, **data)
                   │    │       │         │     │      └ {'user_id': 2018405152, 'message_type': 'private', 'message': [MessageSegment(type='image', data={'file': 'https://api.dujin....
                   │    │       │         │     └ 'send_msg'
                   │    │       │         └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
                   │    │       └ <function Adapter._call_api at 0x7f1a4be785e0>
                   │    └ <nonebot.adapters.onebot.v11.adapter.Adapter object at 0x7f1a4bec7dc0>
                   └ <nonebot.adapters.onebot.v11.bot.Bot object at 0x7f1a2e340760>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/v11/adapter.py", line 131, in _call_api
    return handle_api_result(
           └ <function handle_api_result at 0x7f1a4beed4c0>
  File "/root/.cache/pypoetry/virtualenvs/littlepaimon-un3aoyyf-py3.9/lib/python3.9/site-packages/nonebot/adapters/onebot/utils.py", line 47, in handle_api_result
    raise ActionFailed(**result)
          │              └ {'data': None, 'echo': '23', 'msg': 'SEND_MSG_API_ERROR', 'retcode': 100, 'status': 'failed', 'wording': '请参考 go-cqhttp 端输出'}
          └ <class 'nonebot.adapters.onebot.exception.ActionFailed'>

nonebot.adapters.onebot.exception.ActionFailed: <ActionFailed data=None, echo=23, msg=SEND_MSG_API_ERROR, retcode=100, status=failed, wording=请参考 go-cqhttp 端输出>
CMHopeSunshine commented 2 years ago

这个基本是随机图片接口寄了的原因