no message

This commit is contained in:
hellcat 2025-11-25 20:28:31 +08:00
parent 080045a48a
commit 069e394990
3 changed files with 47 additions and 3 deletions

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Services;
use App\Services\Cron\HttpQueue as CronHttpQueue;
use App\Services\Cron\Book as CronBook;
use App\Services\Cron\ArticleSchema as CronArticleSchema;
use App\Services\TomTool\Telegram\Slave as TeleSlave;
@ -28,10 +29,12 @@ final class Cron
}
echo "cron开始执行\n\n";
// TeleSlave::log()->enableSlaveQueue(false)->send("master_cron_run:".date("Y-m-d H:i:s"));
if ($h % 6 === 0) {
CronBook::randbox_notify();
}
if ($i % 3 === 0) {
// TeleSlave::log()->enableSlaveQueue(false)->send("master_cron_run__hit!!:".date("Y-m-d H:i:s"));
CronArticleSchema::cacheTgSave();
CronArticleSchema::pushToSlave();
CronHttpQueue::pop();

View File

@ -0,0 +1,41 @@
<?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);
}
}

View File

@ -33,7 +33,7 @@ class Cron extends Base {
$oServicesCron = new ServicesCron();
$oServicesCron->setTestH('00');
$oServicesCron->setTestH('06');
$oServicesCron->setTestI('00');
$oServicesCron->setTestS('00');