X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FChannelController.php;h=622276b9c4e56bde9d3e7ac4aea421cb8e558dd8;hb=1d3c8c6a96fc45d839f0e3719baca790059d189f;hp=c47a4066a20a2d80112558498c1f198c9538786b;hpb=7649d12f400f164dd06f6a45486221234052dbb6;p=alttp.git diff --git a/app/Http/Controllers/ChannelController.php b/app/Http/Controllers/ChannelController.php index c47a406..622276b 100644 --- a/app/Http/Controllers/ChannelController.php +++ b/app/Http/Controllers/ChannelController.php @@ -55,11 +55,13 @@ class ChannelController extends Controller { } $validatedData = $request->validate([ 'bot_nick' => 'string', - 'text' => 'string|required', + 'category' => 'string', + 'text' => 'string', ]); $this->authorize('editRestream', $channel); $nick = empty($validatedData['bot_nick']) ? 'localhorsttv' : $validatedData['bot_nick']; - TwitchBotCommand::chat($channel->twitch_chat, $validatedData['text'], $request->user(), $nick); + $text = empty($validatedData['category']) ? $validatedData['text'] : $channel->randomOfClass($validatedData['category']); + TwitchBotCommand::chat($channel->twitch_chat, $text, $request->user(), $nick); return $this->sendChannel($channel); } @@ -68,6 +70,8 @@ class ChannelController extends Controller { throw new \Exception('channel has no twitch chat set'); } $validatedData = $request->validate([ + 'language' => 'string|in:de,en,es,fr', + 'respond' => 'string|in:50,no,yes', 'wait_msgs_min' => 'integer|min:1', 'wait_msgs_max' => 'integer', 'wait_time_min' => 'integer',