feat:截断过早的超长消息,防止神秘破限词

This commit is contained in:
SengokuCola
2025-04-29 19:20:43 +08:00
parent ff94014032
commit 233d2f6f12
5 changed files with 102 additions and 16 deletions

16
scripts/count.py Normal file
View File

@@ -0,0 +1,16 @@
def 计算字符串长度(输入字符串: str) -> int:
"""计算输入字符串的长度
参数:
输入字符串: 要计算长度的字符串
返回:
字符串的长度(整数)
"""
return len(输入字符串)
if __name__ == "__main__":
# 测试代码
测试字符串 = '''你。'''
print(f"字符串 '{测试字符串}' 的长度是: {计算字符串长度(测试字符串)}")