TDK1969 / nonebot_plugin_bilibilibot

基于Nonebot的bilibili通知插件,可将up主,主播以及番剧的更新/直播动态推送到QQ
GNU General Public License v3.0
98 stars 7 forks source link

指令报错 #4

Closed TTH23 closed 2 years ago

TTH23 commented 2 years ago

image image image 下载zip后把file拖进C:\Users\User\AppData\Local\Programs\Python\Python39\Lib\site-packages\nonebot_plugin_bilibilibot后报错如下 image 萌新 哪里有很傻的地方请指出(捂脸 beta2版本

TDK1969 commented 2 years ago

请问是通过什么方法安装的? 下载zip后的把file拖进……后,请提供完整的日志,看不到具体的报错

TTH23 commented 2 years ago

使用的nb plugin install nonebot-plugin-bilibilibot指令安装的 image image 这是导入的图片 txt点进去看了是有文字的 image C:\Users\28339\AppData\Local\Programs\Python\Python39\Lib\site-packages\nonebot_plugin_bilibilibot\file 这是我放的路径 按照报错里的路径放置的 image 这是载入的插件 image 这是site-packages文件夹

TDK1969 commented 2 years ago

可能是编码的问题?我研究一下

TDK1969 commented 2 years ago

你可以试一下修改init.py文件中的sendHelpMsg函数,修改为如下内容:

async def sendHelpMsg(event: MessageEvent):
    userID = event.sender.user_id
    helpMsg = ""
    with open(f'{PackagePath}/file/source/help.txt', 'r', encoding='utf-8') as f:
        helpMsg = f.read()
    await helpCommand.finish(helpMsg)

看看这样还会不会报错

TDK1969 commented 2 years ago

请更新到2.0.3版本,修复了该问题 如果问题仍然存在,请向我反馈