refactor: simplify system check in chat api

This commit is contained in:
Roardom
2025-08-21 09:15:34 +00:00
parent de827aa939
commit 66b6eecd32
@@ -159,7 +159,6 @@ class ChatController extends Controller
$bots = cache()->remember('bots', 3600, fn () => Bot::where('active', '=', 1)->orderByDesc('position')->get());
$which = null;
$target = null;
$runbot = null;
$trip = 'msg';
@@ -182,11 +181,7 @@ class ChatController extends Controller
if (str_starts_with($message, '/'.$trip)) {
$which = 'echo';
$target = 'system';
$message = '/bot gift'.substr($message, \strlen($trip) + 1, \strlen($message));
}
if ($target == 'system') {
$runbot = new SystemBot($this->chatRepository);
}