Skip to content

fix(Bot): 修复Overflow中无法正常获取replyImage的问题 - #136

Merged
Dituon merged 1 commit into
Dituon:devfrom
EvolvedGhost:dev
Aug 5, 2025
Merged

fix(Bot): 修复Overflow中无法正常获取replyImage的问题#136
Dituon merged 1 commit into
Dituon:devfrom
EvolvedGhost:dev

Conversation

@EvolvedGhost

Copy link
Copy Markdown
Contributor

Overflow中存在QuotaReply中TargetId为0的情况

如图所示,回复图片petpet出现的依然是发送人的头像
image
日志大致如下(Stdout为Petpet内部获取缓存图片的ID和MessageSource类):

2025-08-04 17:14:12 V/Bot.【BotId】: [测试(【GroupId】)] 【NickName】(【UserId】) -> [overflow:image,url=https://IMAGEURL]
2025-08-04 17:14:12 I/stdout: [SourceId]1313310701
2025-08-04 17:14:12 I/stdout: [mirai:source:ids=[294953152], internalIds=[294953152], from group 【UserId】 to 【GroupId】 at 1754****52]
2025-08-04 17:14:15 V/Bot.【BotId】: [测试(【GroupId】)] 【NickName】(【UserId】) -> [mirai:quote:[mirai:source:ids=[294953152], internalIds=[294953152], from 【UserId】 to 0 at 1754****52], content=[overflow:image,url=https://IMAGEURL]]333
2025-08-04 17:14:15 I/stdout: [SourceId]294***152
2025-08-04 17:14:15 I/stdout: [mirai:source:ids=[294953152], internalIds=[294953152], from 【UserId】 to 0 at 1754****52]

可以看到GroupId在MessageSource变成了0

解决方案

提供一个TargetID给函数可以解决(因为我们可以无脑将QuotaReply视作在一个Target下),恢复正常:
image

或者看看有没有更优雅点的?

@vercel

vercel Bot commented Aug 4, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
petpet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 9:32am

@Dituon
Dituon merged commit 2f7869e into Dituon:dev Aug 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants