Update src/plugins/chat/utils.py

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
pull/634/head
Bakadax 2025-04-02 11:39:33 +08:00 committed by GitHub
parent 6c448c0a73
commit e9f89aeaf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -362,7 +362,7 @@ def calculate_typing_time(input_string: str, chinese_time: float = 0.2, english_
"""
# 回复、发送图片/表情包操作短暂计时
total_time = 0.0
pattern = re.compile(r'\[[回复 ,表情包:,图片:][\s\S]*?\]')
pattern = re.compile(r'\[(回复|表情包:|图片:)[\s\S]*?\]')
if re.match(pattern, input_string):
input_string = re.sub(pattern, '', input_string)
total_time += random.randrange(1, 3)