txlyre 11 月之前
父節點
當前提交
799d6c5ab3
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      commands.py

+ 2 - 1
commands.py

@@ -545,13 +545,14 @@ async def sylvy_handler(bot, event, command):
     text += '\n'
 
   text += result['output']
+  text = text.strip()
 
   await event.reply(
     text,
     formatting_entities=[
       MessageEntityCode(
         offset=0,
-        length=len(text.strip())
+        length=len(text.encode('utf-16')) // 2
       )
     ]
   )