perf: 优化机器人Webhook消息

This commit is contained in:
kuaifan
2025-03-24 15:25:02 +08:00
parent d366cf9885
commit a49c0aea47
6 changed files with 154 additions and 113 deletions

View File

@@ -629,12 +629,11 @@ class UsersController extends AbstractController
User::auth();
//
$type = trim(Request::input('type'));
$botName = "ai-{$type}";
if (!UserBot::isAiBot("{$botName}@bot.system")) {
if (!UserBot::systemBotName($type)) {
return Base::retError('AI机器人不存在');
}
//
$botUser = User::botGetOrCreate($botName);
$botUser = User::botGetOrCreate("ai-{$type}");
if (empty($botUser)) {
return Base::retError('AI机器人不存在');
}