-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event 文本获取错误 #19
Comments
找到了,是这里的问题 adapter-discord/nonebot/adapters/discord/message.py Lines 315 to 322 in 0251686
对于 event.get_message() 的 __str__ 函数为
def __str__(self) -> str:
return "".join(str(seg) for seg in self) 而对于 def extract_plain_text(self) -> str:
"""提取消息内纯文本消息"""
return "".join(str(seg) for seg in self if seg.is_text()) 两者都会触发 adapter-discord/nonebot/adapters/discord/utils.py Lines 50 to 51 in 0251686
|
我还发现了 原因是处理 并没有调用 我想也许要改为 adapter-discord/nonebot/adapters/discord/message.py Lines 433 to 439 in 0251686
|
而对于 在匹配形如 也许正则要改为 adapter-discord/nonebot/adapters/discord/message.py Lines 395 to 400 in 0251686
|
感谢反馈解决!愿意发个PR吗 |
@paul-sama 麻烦帮忙试试最新 commit 版本 |
嗯,最新版本修复好了 |
* 🐛 修复 event 文本获取错误 #19 * 🐛 修改 `Message._construct()` 的正则 * ✨ 为 Webhook 中的 source_guild 和 source_channel 添加单独的类 🐛 修正 source_guild, source_channel 的类型标注 * 🐛 为 `icon` 添加默认值 thanks, shoucandanghehe Co-authored-by: 呵呵です <[email protected]> --------- Co-authored-by: 呵呵です <[email protected]>
输入
123&123<123
结果都是
123&123<123
The text was updated successfully, but these errors were encountered: