X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FChannelController.php;h=026b9aa8ce9fe18c7d0978be820fc1e911c12018;hb=771f1761f0abec996838c0ccc71cec0219bad71a;hp=883ca65eff2360d93bcd20d9fb2d2bf93640caad;hpb=ebdf8e5f6761de2abd85b01096a67dee62d7d4aa;p=alttp.git diff --git a/app/Http/Controllers/ChannelController.php b/app/Http/Controllers/ChannelController.php index 883ca65..026b9aa 100644 --- a/app/Http/Controllers/ChannelController.php +++ b/app/Http/Controllers/ChannelController.php @@ -68,15 +68,27 @@ class ChannelController extends Controller { return $this->sendChannel($channel); } + public function chatBotLog(Request $request, Channel $channel) { + $this->authorize('editRestream', $channel); + $log = $channel->chat_bot_logs() + ->with(['origin', 'user']) + ->orderBy('created_at', 'DESC') + ->limit(150) + ->get(); + return $log->values()->toJson(); + } + public function chatSettings(Request $request, Channel $channel) { if (!$channel->twitch_chat) { throw new \Exception('channel has no twitch chat set'); } $validatedData = $request->validate([ 'language' => 'string|in:de,en,es,fr', + 'min_age' => 'integer|min:1', 'respond' => 'string|in:50,no,yes', + 'source' => 'string|in:any,cat,catchan,chan', 'wait_msgs_min' => 'integer|min:1', - 'wait_msgs_max' => 'integer', + 'wait_msgs_max' => 'integer|min:1', 'wait_time_min' => 'integer', 'wait_time_max' => 'integer', ]);