SAGIRI-kawaii / sagiri-bot

基于Graia Ariadne和Mirai的QQ机器人 SAGIRI-BOT
GNU Affero General Public License v3.0
696 stars 83 forks source link

[Bug Report]ddcheck_查成分报错 #261

Closed ayakasuki closed 2 years ago

ayakasuki commented 2 years ago

问题 查成分报错无反应,看后台报错

使用环境:

日志/截图 image image

`Traceback (most recent call last):

File "/bot/sagiri/sagiri-bot/main.py", line 88, in core.launch() │ └ <function AppCore.launch at 0x7f7fdaa77550> └ <sagiri_bot.core.app_core.AppCore object at 0x7f7fdf04cf70>

File "/bot/sagiri/sagiri-bot/sagiri_bot/core/app_core.py", line 129, in launch self.__app.launch_blocking() └ <sagiri_bot.core.app_core.AppCore object at 0x7f7fdf04cf70>

File "/root/miniconda3/lib/python3.9/site-packages/graia/ariadne/app.py", line 1724, in launch_blocking self.loop.run_until_complete(self.lifecycle()) │ │ │ │ └ <function Ariadne.lifecycle at 0x7f7fde68cd30> │ │ │ └ <graia.ariadne.app.Ariadne object at 0x7f7fda9ac700> │ │ └ <function BaseEventLoop.run_until_complete at 0x7f7fde8d0ee0> │ └ <_UnixSelectorEventLoop running=True closed=False debug=False> └ <graia.ariadne.app.Ariadne object at 0x7f7fda9ac700> File "/root/miniconda3/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete self.run_forever() │ └ <function BaseEventLoop.run_forever at 0x7f7fde8d0e50> └ <_UnixSelectorEventLoop running=True closed=False debug=False> File "/root/miniconda3/lib/python3.9/asyncio/base_events.py", line 601, in run_forever self._run_once() │ └ <function BaseEventLoop._run_once at 0x7f7fde8d39d0> └ <_UnixSelectorEventLoop running=True closed=False debug=False> File "/root/miniconda3/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once handle._run() │ └ <function Handle._run at 0x7f7fde9173a0> └ <Handle <TaskWakeupMethWrapper object at 0x7f7f5a1595e0>()> File "/root/miniconda3/lib/python3.9/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) │ │ │ │ │ └ <member '_args' of 'Handle' objects> │ │ │ │ └ <Handle <TaskWakeupMethWrapper object at 0x7f7f5a1595e0>(result=None>)> │ │ │ └ <member '_callback' of 'Handle' objects> │ │ └ <Handle <TaskWakeupMethWrapper object at 0x7f7f5a1595e0>()> │ └ <member '_context' of 'Handle' objects> └ <Handle <TaskWakeupMethWrapper object at 0x7f7f5a1595e0>()>

File "/root/miniconda3/lib/python3.9/site-packages/graia/broadcast/init.py", line 204, in Executor result = await run_always_await_safely(target_callable, *parameter_compile_result) │ │ └ {'app': <graia.ariadne.app.Ariadne object at 0x7f7fda9ac700>, 'group': >Group(id=336549761, name='桃子秘书群', accountPerm=<管理员>), ... │ └ <function dd_check at 0x7f7fa0f6f8b0> └ <function run_always_await_safely at 0x7f7fde5c7820> File "/root/miniconda3/lib/python3.9/site-packages/graia/broadcast/utilles.py", line 39, in run_always_await_safely return await callable(args, **kwargs) │ │ └ {'app': <graia.ariadne.app.Ariadne object at 0x7f7fda9ac700>, 'group': Group(id=336549761, >name='桃子秘书群', accountPerm=<管理员>), ... │ └ () └ <function dd_check at 0x7f7fa0f6f8b0>

File "/bot/sagiri/sagiri-bot/sagiri_bot/handler/handlers/dd_check/init.py", line 41, in dd_check res = await get_reply(username.result.asDisplay().strip()) │ │ └ <member 'result' of 'MatchResult' objects> │ └ MatchResult(matched=True, result=MessageChain([Plain(text='南琴梨喝水中')]), origin=WildcardMatch('.*', >space='PRESERVE', flags=)) └ <function get_reply at 0x7f7fa0f6f550>

File "/bot/sagiri/sagiri-bot/sagiri_bot/handler/handlers/dd_check/utils.py", line 143, in get_reply user_info = await get_user_info(uid) │ └ 4103683 └ <function get_user_info at 0x7f7fa0f6f310>

File "/bot/sagiri/sagiri-bot/sagiri_bot/handler/handlers/dd_check/utils.py", line 94, in get_user_info result = await resp.json() │ └ <function ClientResponse.json at 0x7f7fdcc26d30> └ <ClientResponse(https://account.bilibili.com/api/member/getCardByMid?mid=4103683) [200 OK]> <CIMultiDictProxy('Date': 'Thu, 0...

File "/root/miniconda3/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json raise ContentTypeError( └ <class 'aiohttp.client_exceptions.ContentTypeError'>

aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; >charset=utf-8', url=URL('https://account.bilibili.com/api/member/getCardByMid?mid=4103683')`

SAGIRI-kawaii commented 2 years ago

fixed