lgc-NB2Dev / nonebot-plugin-picmcstat

A NoneBot2 plugin generates a pic from a Minecraft server's MOTD
MIT License
16 stars 3 forks source link

查询基岩版服务器报错 #7

Closed YuYue-Amatsuki closed 1 year ago

YuYue-Amatsuki commented 1 year ago
06-17 14:40:23 [SUCCESS] nonebot | OneBot V11 257******* | [message.group.normal]: Message 482100725 from 245*****3@[群:518****01] '查服be'
06-17 14:40:23 [DEBUG] nonebot | Checking for matchers in priority 1...
06-17 14:40:23 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_picmcstat.__main__)
06-17 14:40:23 [DEBUG] nonebot | Running Matcher(type='message', module=nonebot_plugin_picmcstat.__main__)
06-17 14:40:23 [DEBUG] nonebot | Running handler Dependent(call=shortcut_handler)
06-17 14:40:24 [ERROR] nonebot_plugin_picmcstat | 获取服务器状态/画服务器状态图出错
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/usr/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot_plugin_reboot/reloader.py", line 27, in _run
    _nb_run(*args, **kwargs)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/__init__.py", line 309, in run
    get_driver().run(*args, **kwargs)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 198, in run
    uvicorn.run(
  File "/home/yuyue/.local/lib/python3.10/site-packages/uvicorn/main.py", line 569, in run
    server.run()
  File "/home/yuyue/.local/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/message.py", line 467, in check_and_run_matcher
    await _run_matcher(
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/message.py", line 419, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 753, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 728, in simple_run
    await handler(
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot_plugin_picmcstat/__main__.py", line 35, in shortcut_handler
    await matcher.finish(await draw(host, svr_type))
> File "/home/yuyue/.local/lib/python3.10/site-packages/nonebot_plugin_picmcstat/draw.py", line 323, in draw
    draw_bedrock(await BedrockServer.lookup(ip).async_status(), ip),
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcstatus/utils.py", line 51, in async_wrapper
    raise last_exc  # type: ignore # (This won't actually be unbound)
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcstatus/utils.py", line 47, in async_wrapper
    return await func(*args, **kwargs)  # type: ignore # (We know func is awaitable here)
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcstatus/server.py", line 220, in async_status
    return await BedrockServerStatus(self.address, self.timeout, **kwargs).read_status_async()
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcstatus/bedrock_status.py", line 70, in read_status_async
    return self.parse_response(data, (end - start) * 1000)
  File "/home/yuyue/.local/lib/python3.10/site-packages/mcstatus/bedrock_status.py", line 27, in parse_response
    decoded_data = data[34 : 34 + name_length].decode().split(";")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 5: invalid continuation byte
06-17 14:40:24 [DEBUG] nonebot | OneBot V11 | Calling API send_msg
06-17 14:40:25 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_picmcstat.__main__) running complete
06-17 14:40:25 [DEBUG] nonebot | Stop event propagation
06-17 14:40:25 [DEBUG] nonebot | Checking for matchers completed