perf: 机器人添加清空上下文菜单

This commit is contained in:
kuaifan
2023-12-14 15:59:04 +08:00
parent d06d1c177c
commit c4e72507e0
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -71,6 +71,9 @@ class BotReceiveMsgTask extends AbstractTask
}
if (preg_match("/<span[^>]*?data-quick-key=([\"'])(.*?)\\1[^>]*?>(.*?)<\/span>/is", $original, $match)) {
$command = $match[2];
if (str_starts_with($command, '%3A.')) {
$command = ":" . substr($command, 4);
}
} else {
$command = trim(strip_tags($original));
}