nonebot / adapter-feishu

NoneBot2 飞书适配器 / FeiShu (LarkSuite) adapter for nonebot2
https://feishu.adapters.nonebot.dev
MIT License
27 stars 6 forks source link

Bug: 在群内@机器人时,如果@放在消息末尾,会导致报错 #81

Closed Yisan5772156 closed 10 months ago

Yisan5772156 commented 10 months ago

描述问题:

当在群内使用"xxxxx @Bot"时,抛出错误 future: <Task finished name='Task-68331' coro=<Bot.handle_event() done, defined at /usr/local/lib/python3.8/site-packages/nonebot/adapters/feishu/bot.py:219> exception=TypeError('string indices must be integers')> Traceback (most recent call last):

File "/usr/local/lib/python3.8/site-packages/nonebot/adapters/feishu/bot.py", line 222, in handle_event _check_nickname(self, event) File "/usr/local/lib/python3.8/site-packages/nonebot/adapters/feishu/bot.py", line 102, in _check_nickname first_text = first_msg_seg.data["text"] TypeError: string indices must be integers

如何复现?

在群内发送"xxxxx @your_bot"

期望的结果

能够将消息接收后由插件自行解析处理这样的消息

StarHeartHunt commented 10 months ago

fixed in 33ba969