mamoe / mirai

高效率 QQ 机器人支持库
https://mirai.mamoe.net
GNU Affero General Public License v3.0
14.28k stars 2.53k forks source link

图片消息的形式为表情包时,构造的 imageId 字符串的图片格式错误 #2803

Open gebederry opened 11 months ago

gebederry commented 11 months ago

问题描述

图片消息的形式为动图表情包 (isEmoji = true) 时,Mirai Code 构造的 imageId 字符串的图片格式错误。 如下方 mirai-console 的日志所示,bot 复读表情包消息,messageChain 中的 {82E979B5-0000-0000-2D59-F32E15D068B3}.jpg 应为 {82E979B5-0000-0000-2D59-F32E15D068B3}.gif。 几个月前使用 2.14.0 版本时,这里没有问题,bot 进行复读的话,复读的内容也是表情包。 2.15.0+ 存在问题。

复现

发送一张动图表情包图片消息,bot 进行复读。

mirai-core 版本

2.16.0-RC (2.16.0-RC-dev-145)

系统日志

mirai-console 的日志 bot 进行复读

2023-09-20 13:40:17 V/Bot.2000000000: [Group A(550000000)] 大橙子(1680000000) -> [mirai:image:{82E979B5-0000-0000-2D59-F32E15D068B3}.jpg, width=300, height=340, size=3272383, type=GIF, isEmoji=true]
2023-09-20 13:40:20 V/Bot.2000000000: Group(550000000) <- [mirai:image:{82E979B5-0000-0000-2D59-F32E15D068B3}.jpg, width=300, height=340, size=3272383, type=JPG, isEmoji=true]

补充信息

几个月前用 mah SDK mirai-ts 写的复读表情包的 js 代码片段,那时使用的 2.14.0,一切都很正常。>.< 😵

if ( sender.id === 1770000000 && messageChain.some( ({ type, imageId }) => type === "Image" && imageId === "{14BB05F0-0000-0000-50BC-82ABAB316225}.gif" ) ) { reply(messageChain); }

现在 gif 变成了 jpg,bot 对表情包消息进行复读 messageChain 时,发的非表情包形式的 gif 动图,效果,不会自动播放。>.<

相关 issues, PRs https://github.com/Nambers/MiraiCP/issues/200 https://github.com/mamoe/mirai/issues/2463

2760 #2761

gebederry commented 11 months ago

其实问题不大,在复读动图表情包时重构修正一下 messageChain 一样的。

Karlatemp commented 11 months ago

请提供消息发送者所使用的QQ版本(什么平台(Windows?Android?Mac OS?),什么QQ(TIM?QQ?QQNT?)和版本号)

gebederry commented 11 months ago

请提供消息发送者所使用的QQ版本(什么平台(Windows?Android?Mac OS?),什么QQ(TIM?QQ?QQNT?)和版本号)