]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/ChannelController.php
protocol chat bot messages
[alttp.git] / app / Http / Controllers / ChannelController.php
index c47a4066a20a2d80112558498c1f198c9538786b..883ca65eff2360d93bcd20d9fb2d2bf93640caad 100644 (file)
@@ -55,11 +55,16 @@ 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);
+               if (empty($validatedData['category'])) {
+                       TwitchBotCommand::chat($channel->twitch_chat, $validatedData['text'], $request->user(), $nick);
+               } else {
+                       TwitchBotCommand::randomChat($channel, $validatedData['category'], $request->user(), $nick);
+               }
                return $this->sendChannel($channel);
        }
 
@@ -68,6 +73,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',