Add bot run job
All checks were successful
Deploy App / deploy (push) Successful in 9s

This commit is contained in:
2025-08-31 14:46:51 +02:00
parent 75be85e608
commit 77ebc6bce1
2 changed files with 31 additions and 3 deletions

29
app/Jobs/RunBot.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
namespace App\Jobs;
use App\Models\Bot;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class RunBot implements ShouldQueue
{
use Queueable;
/**
* Create a new job instance.
*/
public function __construct(private Bot $bot)
{
}
/**
* Execute the job.
*/
public function handle(): void
{
$class = new $this->bot->class($this->bot->config ?? []);
$class->run();
}
}