SAGIRI-kawaii / sagiri-bot

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

[Help]__new__() missing 1 required positional argument: 'frequency_limit_dict' #5

Closed Evyde closed 3 years ago

Evyde commented 3 years ago

大佬您好,麻烦您了。

接收到组测试群组中来自爬的消息:pdf hi
[2021-01-13 17:21:44,842][DEBUG]: caching sha2: succeeded by fast path.
[2021-01-13 17:21:44,856][DEBUG]: caching sha2: succeeded by fast path.
[2021-01-13 17:21:44,859][DEBUG]: caching sha2: succeeded by fast path.
[2021-01-13 17:21:44,861][DEBUG]: caching sha2: succeeded by fast path.
[2021-01-13 17:21:44,879][DEBUG]: caching sha2: succeeded by fast path.
[2021-01-13 17:21:45,076][INFO]: [BOT 3419347622] Group(595895111) <- "__new__() missing 1 required positional argument: 'frequency_limit_dict'"

以下是配置文件:

{
    "BotQQ": 341****622,
    "HostQQ": ********,
    "authKey": "authKey*******",
    "miraiHost": "localhost:8880/",
    "dbHost": "127.0.0.1",
    "dbName": "qqbot",
    "dbUser": "qqbot",
    "dbPass": "*********",
    "setuPath": "/root/qqbotcache/setuPath",
    "setu18Path": "/root/qqbotcache/setu18Path",
    "realPath": "/root/qqbotcache/realPath",
    "realHighqPath": "/root/qqbotcache/realHighqPath",
    "searchPath": "/root/qqbotcache/searchPath",
    "yellowJudgePath": "/root/qqbotcache/yellowJudgePath",
    "clockWallpaperPreviewPath": "/root/qqbotcache/clockWallpaperPreviewPath",
    "clockWallpaperSavedPath": "/root/qqbotcache/clockWallpaperSavedPath",
    "tributePath": "/root/qqbotcache/tributePath",
    "wallpaperPath": "/root/qqbotcache/wallpaperPath",
    "imgSavePath": "/root/qqbotcache/imgSavePath",
    "listenImagePath": "/root/qqbotcache/listenImagePath",
    "steamSearchPath": "/root/qqbotcache/steamSearchPath",
    "txAppId": "",
    "txAppKey": "",
    "shadiaoAppName": "",
    "environment": "",
    "oldVersion": "",
    "newVersion": "",
    "repeat": "True"
}
SAGIRI-kawaii commented 3 years ago

请尝试升级到最新版本,如果还出现错误,就让我想想怎么回事(不是

Evyde commented 3 years ago

请尝试升级到最新版本,如果还出现错误,就让我想想怎么回事(不是

是昨天才Clone下来的,太奇怪了。

Evyde commented 3 years ago

刚刚测试,这个问题也消失了,应该是 #3 的衍生问题。
不过又有新问题了,使用pdf hi时,返回了Cannot open resouce,但是文件夹权限bot/statics/temp我已经设置成777了,查看目录中也有图片文件。

Evyde commented 3 years ago

刚刚测试,这个问题也消失了,应该是 #3 的衍生问题。 不过又有新问题了,使用pdf hi时,返回了Cannot open resouce,但是文件夹权限bot/statics/temp我已经设置成777了,查看目录中也有图片文件。

命令可以正常使用。

SAGIRI-kawaii commented 3 years ago

可将 sagiri-bot.py 中 324-332 行的

        try:
            message_send = await group_message_process(message, message_info, app, frequency_limit_dict)
        except Exception as e:
            message_send = [
                "quoteSource",
                MessageChain.create([
                    Plain(text=str(e))
                ])
            ]

更改为

message_send = await group_message_process(message, message_info, app, frequency_limit_dict)

再次运行复现错误以在控制台查看报错信息,如果可以,请将报错信息包括报错位置等发送给我

Evyde commented 3 years ago

感谢大佬私聊指点,已经解决。
首先请先注意配置文件中目录名称是否正确,以及权限是否可以访问到(statics目录需要对应用户组的rw权限)。
然后请寻找对应不可以正常使用功能的源码,将其中带有字体文件引用的,例如./statics/simhei.ttf改成您自己上传的字体路径。目前来看,涉及到的文件有:SAGIRIBOT/basics/tools.pySAGIRIBOT/functions/get_review.py。希望大佬可以在配置文件里加入字体选择。