Cut off plaintext body if the event is too long
This commit is contained in:
parent
dd58135c94
commit
bceacb97a0
1 changed files with 4 additions and 1 deletions
|
@ -62,7 +62,10 @@ async def parse_formatted(
|
|||
html = message
|
||||
else:
|
||||
return message, escape(message)
|
||||
return (await MaubotHTMLParser().parse(html)).text, html
|
||||
text = (await MaubotHTMLParser().parse(html)).text
|
||||
if len(text) + len(html) > 60000:
|
||||
text = text[:100] + "[long message cut off]"
|
||||
return text, html
|
||||
|
||||
|
||||
class MaubotMessageEvent(MessageEvent):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue