-
-
Notifications
You must be signed in to change notification settings - Fork 293
Bug: Telegram 适配器无法正确读取消息中的 @ #1452
Copy link
Copy link
Closed
Labels
bugBUGBUG
Description
Describe the bug
如果你使用以下指令尝试从 @ 中读取用户 id
ctx.command("test <user:user>")
.action(async (_, userStr) => {
ctx.logger('test').info(userStr)
})以下是详细日志
2024-08-25 14:59:28 [D] telegram [response] { ok: true, result: [ { update_id: 561271410, message: { message_id: 425, from: { id: 5420165211, is_bot: false, first_name: 'd0j1a1701', username: 'd0j1a1701', language_code: 'zh-hans', is_premium: true }, chat: { id: -1002201482660, title: '「香草」测试群', type: 'supergroup' }, date: 1724569167, text: '/test @d0j1a1701', entities: [ { offset: 0, length: 5, type: 'bot_command' }, { offset: 6, length: 10, type: 'mention' } ] } } ] }
2024-08-25 14:59:28 [D] telegram receive {"update_id":561271410,"message":{"message_id":425,"from":{"id":5420165211,"is_bot":false,"first_name":"d0j1a1701","username":"d0j1a1701","language_code":"zh-hans","is_premium":true},"chat":{"id":-1002201482660,"title":"「香草」测试群","type":"supergroup"},"date":1724569167,"text":"/test @d0j1a1701","entities":[{"offset":0,"length":5,"type":"bot_command"},{"offset":6,"length":10,"type":"mention"}]}}
2024-08-25 14:59:28 [I] test telegram:undefined
可以看到一个巨大的 telegram:undefined 呈现在眼前。
Steps to reproduce
最小复现代码如上
Expected behavior
我们拿出接入 NapCat 的 onebot 适配器。
2024-08-25 15:01:10 [I] test onebot:30******26 // 被 @ 人的正确 QQ 号码。
Screenshots
No response
Versions
System:
OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (4) x64 AMD EPYC 7B13 64-Core Processor
Binaries:
Node: 21.7.3
Yarn: 4.1.1
Koishi:
Core: 4.17.12
Console: 5.29.3
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBUGBUG


