X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FChannelController.php;fp=app%2FHttp%2FControllers%2FChannelController.php;h=f1f3cdbeb4038da5cc8b12a7dc9b2b6060645ea2;hb=e49b130505f5712075dca2ff990e5a63fc90ce3c;hp=b735a6f70b3e3e6fcc45c0df81dfd9446af970e9;hpb=06fbdc15c8db57590c9b6a38ee1f00d5f349cff9;p=alttp.git diff --git a/app/Http/Controllers/ChannelController.php b/app/Http/Controllers/ChannelController.php index b735a6f..f1f3cdb 100644 --- a/app/Http/Controllers/ChannelController.php +++ b/app/Http/Controllers/ChannelController.php @@ -56,6 +56,22 @@ class ChannelController extends Controller { return $channel->toJson(); } + public function chatSettings(Request $request, Channel $channel) { + if (!$channel->twitch_chat) { + throw new \Exception('channel has no twitch chat set'); + } + $validatedData = $request->validate([ + 'wait_msgs_min' => 'integer|min:1', + 'wait_msgs_max' => 'integer', + 'wait_time_min' => 'integer', + 'wait_time_max' => 'integer', + ]); + $this->authorize('editRestream', $channel); + $channel->chat_settings = $validatedData; + $channel->save(); + return $channel->toJson(); + } + public function join(Request $request, Channel $channel) { if (!$channel->twitch_chat) { throw new \Exception('channel has no twitch chat set');