namespace App\TwitchBot;
use App\Models\Channel;
-use App\Models\TwitchBotCommand;
class TwitchAppBot extends TwitchBot {
}
}
-
- private function listenCommands() {
- $this->getLoop()->addPeriodicTimer(1, function () {
- if (!$this->isReady()) return;
- $command = TwitchBotCommand::where('status', '=', 'pending')->oldest()->first();
- if ($command) {
- try {
- $command->execute($this);
- } catch (\Exception $e) {
- }
- }
- });
- }
-
}