File tree Expand file tree Collapse file tree
src/nonebot_plugin_onebot2tg Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525- [ ] 贴纸图片过大时自动压缩?
2626- [ ] GIF转发
2727- [ ] 显示具体表情而不是表情ID
28- - [ ] 显示@人的昵称而不是QQ号
28+ - [x ] 显示@人的昵称而不是QQ号
2929- [ ] 双向转发Reply消息 这个可能需要做数据库
3030- [ ] 在实现Reply消息后 实现转发模式双向转发
3131...
Original file line number Diff line number Diff line change @@ -165,7 +165,14 @@ async def _ob11_message_to_tg(
165165 elif seg .type == "face" :
166166 caption_parts .append (f"[表情:{ seg .data .get ('id' , '' )} ]" )
167167 elif seg .type == "at" :
168- caption_parts .append (f"@{ seg .data .get ('qq' , '' )} " )
168+ at_qq = seg .data .get ("qq" , "" )
169+ at_name = at_qq
170+ try :
171+ stranger_info = await bot .get_stranger_info (user_id = int (at_qq ))
172+ at_name = stranger_info .get ("nickname" , at_qq )
173+ except Exception :
174+ pass
175+ caption_parts .append (f"@{ at_name } " )
169176 elif seg .type == "reply" :
170177 pass
171178 else :
You can’t perform that action at this time.
0 commit comments