mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 05:06:56 +08:00
🚑 fix not delete empty text
This commit is contained in:
parent
5fb9799807
commit
e5213eb95a
@ -118,9 +118,11 @@ async def _check_reply(bot: "Bot", event: "Event"):
|
||||
del event.message[index]
|
||||
if len(event.message) > index and event.message[index].type == "at":
|
||||
del event.message[index]
|
||||
if len(event.message) > index and event.message[index].type == "text":
|
||||
event.message[index].data["text"] = event.message[index].data[
|
||||
"text"].strip()
|
||||
if len(event.message) > index and event.message[index].type == "text":
|
||||
event.message[index].data["text"] = event.message[index].data[
|
||||
"text"].lstrip()
|
||||
if not event.message[index].data["text"]:
|
||||
del event.message[index]
|
||||
if not event.message:
|
||||
event.message.append(MessageSegment.text(""))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user