]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/ChannelController.php
protocol chat bot messages
[alttp.git] / app / Http / Controllers / ChannelController.php
index 622276b9c4e56bde9d3e7ac4aea421cb8e558dd8..883ca65eff2360d93bcd20d9fb2d2bf93640caad 100644 (file)
@@ -60,8 +60,11 @@ class ChannelController extends Controller {
                ]);
                $this->authorize('editRestream', $channel);
                $nick = empty($validatedData['bot_nick']) ? 'localhorsttv' : $validatedData['bot_nick'];
-               $text = empty($validatedData['category']) ? $validatedData['text'] : $channel->randomOfClass($validatedData['category']);
-               TwitchBotCommand::chat($channel->twitch_chat, $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);
        }