mirror of
https://github.com/v2board/v2board.git
synced 2025-06-12 20:47:56 +08:00
telegram: order notify
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace App\Services;
|
||||
|
||||
use App\Jobs\SendTelegramJob;
|
||||
use \Curl\Curl;
|
||||
|
||||
class TelegramService {
|
||||
@ -43,4 +44,15 @@ class TelegramService {
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function sendMessageWithAdmin($message)
|
||||
{
|
||||
if (!config('v2board.telegram_bot_enable', 0)) return;
|
||||
$users = User::where('is_admin', 1)
|
||||
->where('telegram_id', '!=', NULL)
|
||||
->get();
|
||||
foreach ($users as $user) {
|
||||
SendTelegramJob::dispatch($user->telegram_id, $message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user