diff --git a/app/Models/UserBot.php b/app/Models/UserBot.php index 8208075b9..c28d297b8 100644 --- a/app/Models/UserBot.php +++ b/app/Models/UserBot.php @@ -114,6 +114,15 @@ class UserBot extends AbstractModel 'label' => Doo::translate('我的机器人') ], ], + 'ai-openai@bot.system', + 'ai-claude@bot.system', + 'ai-wenxin@bot.system', + 'ai-qianwen@bot.system' => [ + [ + 'key' => '%3A.clear', + 'label' => Doo::translate('清空上下文') + ] + ], default => [], }; diff --git a/app/Tasks/BotReceiveMsgTask.php b/app/Tasks/BotReceiveMsgTask.php index a51ddbad8..6c5f4aacb 100644 --- a/app/Tasks/BotReceiveMsgTask.php +++ b/app/Tasks/BotReceiveMsgTask.php @@ -71,6 +71,9 @@ class BotReceiveMsgTask extends AbstractTask } if (preg_match("/]*?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)); }