From 56a75afadfb26ed0ec5820b4b3170c2ffb0e75d4 Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Thu, 2 Oct 2025 21:58:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(adapter):=20=E4=BF=AE=E5=A4=8D=E8=A1=A8?= =?UTF-8?q?=E6=83=85=E5=9B=9E=E5=BA=94=E5=91=BD=E4=BB=A4=E5=B9=B6=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=BA=9F=E5=BC=83=E7=9A=84emoji=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复了`napcat_adapter`中表情回应命令名称不一致的问题,将`set_emoji_like`统一为`set_msg_emoji_like`。 - 修正了`SendHandler`中`set_like`参数的类型转换,从`str`改为`bool`,以符合API要求。 - 移除了`social_toolkit_plugin`中已废弃且不准确的Unicode emoji到QQ表情文本的映射。 - 更新了配置文件模板的版本号至`7.1.5`。 --- .../napcat_adapter_plugin/src/__init__.py | 2 +- .../napcat_adapter_plugin/src/send_handler.py | 4 +- .../social_toolkit_plugin/qq_emoji_list.py | 68 ------------------- template/bot_config_template.toml | 4 +- 4 files changed, 5 insertions(+), 73 deletions(-) diff --git a/src/plugins/built_in/napcat_adapter_plugin/src/__init__.py b/src/plugins/built_in/napcat_adapter_plugin/src/__init__.py index 17137400b..f8f446c70 100644 --- a/src/plugins/built_in/napcat_adapter_plugin/src/__init__.py +++ b/src/plugins/built_in/napcat_adapter_plugin/src/__init__.py @@ -15,7 +15,7 @@ class CommandType(Enum): SEND_POKE = "send_poke" # 戳一戳 DELETE_MSG = "delete_msg" # 撤回消息 AI_VOICE_SEND = "send_group_ai_record" # 发送群AI语音 - SET_EMOJI_LIKE = "set_emoji_like" # 设置表情回应 + SET_EMOJI_LIKE = "set_msg_emoji_like" # 设置表情回应 SEND_AT_MESSAGE = "send_at_message" # 艾特用户并发送消息 SEND_LIKE = "send_like" # 点赞 diff --git a/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py b/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py index 411b957dc..6da55df00 100644 --- a/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py +++ b/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py @@ -537,13 +537,13 @@ class SendHandler: try: message_id = int(args["message_id"]) emoji_id = int(args["emoji_id"]) - set_like = str(args["set"]) + set_like = bool(args["set"]) except (KeyError, ValueError) as e: logger.error(f"处理表情回应命令时发生错误: {e}, 原始参数: {args}") raise ValueError(f"缺少必需参数或参数类型错误: {e}") return ( - "set_msg_emoji_like", + CommandType.SET_EMOJI_LIKE.value, {"message_id": message_id, "emoji_id": emoji_id, "set": set_like}, ) diff --git a/src/plugins/built_in/social_toolkit_plugin/qq_emoji_list.py b/src/plugins/built_in/social_toolkit_plugin/qq_emoji_list.py index 06682a247..f77aa1b9d 100644 --- a/src/plugins/built_in/social_toolkit_plugin/qq_emoji_list.py +++ b/src/plugins/built_in/social_toolkit_plugin/qq_emoji_list.py @@ -181,72 +181,4 @@ qq_face: dict = { "395": "[表情:略略略]", "396": "[表情:龙年快乐]", "424": " [表情:按钮]", - "😊": "[表情:嘿嘿]", - "😌": "[表情:羞涩]", - "😚": "[ 表情:亲亲]", - "😓": "[表情:汗]", - "😰": "[表情:紧张]", - "😝": "[表情:吐舌]", - "😁": "[表情:呲牙]", - "😜": "[表情:淘气]", - "☺": "[表情:可爱]", - "😍": "[表情:花痴]", - "😔": "[表情:失落]", - "😄": "[表情:高兴]", - "😏": "[表情:哼哼]", - "😒": "[表情:不屑]", - "😳": "[表情:瞪眼]", - "😘": "[表情:飞吻]", - "😭": "[表情:大哭]", - "😱": "[表情:害怕]", - "😂": "[表情:激动]", - "💪": "[表情:肌肉]", - "👊": "[表情:拳头]", - "👍": "[表情 :厉害]", - "👏": "[表情:鼓掌]", - "👎": "[表情:鄙视]", - "🙏": "[表情:合十]", - "👌": "[表情:好的]", - "👆": "[表情:向上]", - "👀": "[表情:眼睛]", - "🍜": "[表情:拉面]", - "🍧": "[表情:刨冰]", - "🍞": "[表情:面包]", - "🍺": "[表情:啤酒]", - "🍻": "[表情:干杯]", - "☕": "[表情:咖啡]", - "🍎": "[表情:苹果]", - "🍓": "[表情:草莓]", - "🍉": "[表情:西瓜]", - "🚬": "[表情:吸烟]", - "🌹": "[表情:玫瑰]", - "🎉": "[表情:庆祝]", - "💝": "[表情:礼物]", - "💣": "[表情:炸弹]", - "✨": "[表情:闪光]", - "💨": "[表情:吹气]", - "💦": "[表情:水]", - "🔥": "[表情:火]", - "💤": "[表情:睡觉]", - "💩": "[表情:便便]", - "💉": "[表情:打针]", - "📫": "[表情:邮箱]", - "🐎": "[表情:骑马]", - "👧": "[表情:女孩]", - "👦": "[表情:男孩]", - "🐵": "[表情:猴]", - "🐷": "[表情:猪]", - "🐮": "[表情:牛]", - "🐔": "[表情:公鸡]", - "🐸": "[表情:青蛙]", - "👻": "[表情:幽灵]", - "🐛": "[表情:虫]", - "🐶": "[表情:狗]", - "🐳": "[表情:鲸鱼]", - "👢": "[表情:靴子]", - "☀": "[表情:晴天]", - "❔": "[表情:问号]", - "🔫": "[表情:手枪]", - "💓": "[表情:爱 心]", - "🏪": "[表情:便利店]", } diff --git a/template/bot_config_template.toml b/template/bot_config_template.toml index d4efa618d..e0097e1ad 100644 --- a/template/bot_config_template.toml +++ b/template/bot_config_template.toml @@ -1,5 +1,5 @@ [inner] -version = "7.1.4" +version = "7.1.5" #----以下是给开发人员阅读的,如果你只是部署了MoFox-Bot,不需要阅读---- #如果你想要修改配置文件,请递增version的值 @@ -366,7 +366,7 @@ library_log_levels = { "aiohttp" = "WARNING"} # 设置特定库的日志级别 [dependency_management] # 插件Python依赖管理配置 # 是否启用自动安装Python依赖包(主开关) -auto_install = true #暂时关闭一下因为还用不了 +auto_install = true #it can work now! # 安装超时时间(秒) auto_install_timeout = 300 # 是否使用PyPI镜像源(推荐,可加速下载)