monsterxcn / nonebot-plugin-gspanel

🤖 NoneBot2 原神游戏内角色展柜数据展示插件,参考 @yoimiya-kokomi/miao-plugin
https://pypi.python.org/pypi/nonebot-plugin-gspanel
MIT License
97 stars 8 forks source link

Yunzai py-plugin 用户常见问题 #17

Closed monsterxcn closed 1 year ago

monsterxcn commented 2 years ago

Yunzai 用户安装 @realhuhu/py-plugin 插件后可以兼容运行此插件!安装步骤如下:

  1. 仔细阅读 README.md - @realhuhu/py-plugin 配置 Yunzai Bot 的 Python 运行环境
  2. 向 Yunzai Bot 发送 QQ 消息 #py下载插件nonebot-plugin-gspanel 安装此插件
  3. 使用须知 第 4 条中交待的所有环境变量写入 py-plugin 的配置文件 config.yaml 中,注意格式
  4. [建议] 将环境变量 gspanel_alias 定义为 面板 以外的触发词,避免此插件与 Yunzai 及其插件的相关功能同时触发

py-plugin 的配置文件 config.yaml 中 务必手动添加 此插件的一些配置,下面的配置仅供参考,不要盲目复制。

log_level: INFO
nickname:
  - 云崽
  - yunzai
superusers:
  - 123456
  - 654321
need_at: no #是否需要@机器人或加上机器人名字,默认no
plugins:
  - nonebot-plugin-petpet
  - nonebot-plugin-memes
  # 加载哪些插件就继续往下加
  - nonebot_plugin_gspanel  # 确保这里有且仅有一个
host: 127.0.0.1
port: 50052
independent: false #py服务器与云崽本体分开启动
#encoding: gbk #如果输出乱码,可以开启这项试试看,主要是windows平台

# nonebot-plugin-gspanel 配置项
gspanel_alias:  # 注意下面 - 前的缩进,空格不要随心所欲
  - 想要的面板触发词
  - 支持多个面板触发词
gspanel_scale: 1.0  # 值越大返回图片分辨率越高
resources_mirror: https://enka.network/ui/
# 下面这个填自己的 py-plugin/data 完整路径,不要照抄!
# 路径一律使用正斜杠 /,不允许反斜杠 \
resources_dir: /path/to/py-plugin/data

有任何 py-plugin 下 安装使用此插件的问题(py-plugin 的问题请去 这里 提问!在此处提问可能被折叠),都可以在下方回帖提问,注意带上具体报错 触发条件日志(通常截取最后一段即可)等信息。

liuzj288 commented 1 year ago

如何让 #面板更新 或 #更新面板 可以更新插件的角色数据

monsterxcn commented 1 year ago

如何让 #面板更新 或 #更新面板 可以更新插件的角色数据

重启 Bot。

另外这个插件好像没有你说的这两个命令,如果你是指获取最新的角色展柜的话,每次查询均默认获取最新展柜数据。

monsterxcn commented 1 year ago

未知问题:https://github.com/monsterxcn/nonebot-plugin-gspanel/issues/21#issue-1501156784

monsterxcn commented 1 year ago

playwright._impl._api_types.TimeoutErrorhttps://github.com/monsterxcn/nonebot-plugin-gspanel/issues/20#issue-1499653063

monsterxcn commented 1 year ago

playwright._impl._api_types.Errorhttps://github.com/monsterxcn/nonebot-plugin-gspanel/issues/23#issue-1520392850

Bricksbreakerd commented 1 year ago

您好

{'log_level': 'INFO', 'nickname': ['云崽', 'yunzai'], 'superusers': [123456, 654321], 'need_at': False, 'plugins': ['nonebot_plugin_gspanel'], 'host': '127.0.0.1', 'port': 50052, 'independent': False, 'encoding': 'gbk', 'gspanel_alias': [' 想要的面板触发词', '支持多个面板触发词'], 'gspanel_scale': 1.0, 'resources_mirror': 'http://file.microgg.cn/ui/', 'resources_dir': 'C:/YunzaiV3/Yunzai-Bot/plugins/py-plugin/data'}
[PyBot][03:15:49.967][INFO] [drivers]Py服务器开机中
[PyBot][03:15:50.420][ERROR] [plugin.manager]插件导入失败: "nonebot_plugin_gspanel"
Traceback (most recent call last):
  File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\main.py", line 13, in <module>
    nonebot.run(root)
  File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\nonebot\__init__.py", line 56, in run
    _driver.run([str(x) for x in _driver.config.plugins])
  File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\nonebot\drivers.py", line 48, in run
    loop.run_until_complete(self.serve(plugins))
  File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 629, in run_until_complete
    self.run_forever()
  File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\windows_events.py", line 316, in run_forever
    super().run_forever()
  File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 596, in run_forever
    self._run_once()
  File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 1890, in _run_once
    handle._run()
  File "c:\users\administrator\appdata\local\programs\python\python39\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\nonebot\drivers.py", line 62, in serve
    load_plugin(plugin.replace("-", "_"))
  File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\nonebot\plugin\load.py", line 34, in load_plugin
    return manager.load_plugin(module_path)
> File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\nonebot\plugin\manager.py", line 141, in load_plugin
    module = importlib.import_module(name)
  File "c:\users\administrator\appdata\local\programs\python\python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\nonebot\plugin\manager.py", line 233, in exec_module
    super().exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\nonebot_plugin_gspanel\__init__.py", line 10, in <module>
    from .data_updater import updateCache
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\nonebot_plugin_gspanel\data_updater.py", line 12, in <module>
    from .data_source import queryDamageApi
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\nonebot_plugin_gspanel\data_source.py", line 21, in <module>
    require("nonebot_plugin_htmlrender")
  File "C:\YunzaiV3\Yunzai-Bot\plugins\py-plugin\nonebot\plugin\load.py", line 161, in require
    return __import__(name)
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\nonebot_plugin_htmlrender\__init__.py", line 4, in <module>
    from .browser import get_browser, get_new_page, shutdown_browser
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\nonebot_plugin_htmlrender\browser.py", line 18, in <module>
    from playwright.async_api import Page, Error, Browser, Playwright, async_playwright
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\playwright\async_api\__init__.py", line 25, in <module>
    import playwright.async_api._generated
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\playwright\async_api\_generated.py", line 25, in <module>
    from playwright._impl._accessibility import Accessibility as AccessibilityImpl
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\playwright\_impl\_accessibility.py", line 17, in <module>
    from playwright._impl._connection import Channel
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\playwright\_impl\_connection.py", line 23, in <module>
    from greenlet import greenlet
  File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\py-plugin-zpnZEtKy-py3.9\lib\site-packages\greenlet\__init__.py", line 29, in <module>
    from ._greenlet import _C_API # pylint:disable=no-name-in-module
ImportError: DLL load failed while importing _greenlet: 找不到指定的模块。

请问大致是什么问题呢?

monsterxcn commented 1 year ago

@Bricksbreakerd 应该是 greenlet 版本的问题,属于 nonebot_plugin_htmlrender 上游 playwright 相关的问题。我替你百度了一下,建议参考下面几个链接或者其他地方自己研究一下吧,注意一定要进入 poetry 虚拟环境后再操作