dd/app/Services/Cron/Book.php
2026-01-02 19:10:22 +08:00

44 lines
1.1 KiB
PHP
Executable File

<?php
declare(strict_types=1);
namespace App\Services\Cron;
//use App\Services\Cron;
use App\Models\Book as ModelBook;
//use App\Services\TomTool\Telegram\Master as TelegramMaster;
use App\Services\TomTool\Telegram\Slave as TelegramSlave;
//use App\Services\TomTool\HttpV2;
//use Telegram\Bot\Api;
////use Telegram\Bot\Exceptions\TelegramSDKException;
//use Telegram\Bot\Exceptions\TelegramSDKException;
//use Telegram\Bot\Exceptions\TelegramResponse;Boo
final class book
{
public static function randbox_notify()
{
$oBook = ModelBook::where("type", "randbox")->first();
$sRandBoxPath = $oBook->path.$oBook->id."/";
$aBookRandbox = ModelBook::where("path", $sRandBoxPath)->where("is_del", 0)->get()->toArray();
$sRandBoxPathLen = count($aBookRandbox) - 1;
$iRandKey = rand(0, $sRandBoxPathLen);
$aGetOne = $aBookRandbox[$iRandKey];
$sMsg = $aGetOne["rag"];
TelegramSlave::notify()->send($sMsg);
// tomd($sMsg);
}
}