mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 17:31:49 +08:00 
			
		
		
		
	fix admin change password
This commit is contained in:
		
							
								
								
									
										43
									
								
								app/Jobs/SendTelegramJob.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								app/Jobs/SendTelegramJob.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Jobs; | ||||
|  | ||||
| use App\Services\TelegramService; | ||||
| use Illuminate\Bus\Queueable; | ||||
| use Illuminate\Contracts\Queue\ShouldQueue; | ||||
| use Illuminate\Foundation\Bus\Dispatchable; | ||||
| use Illuminate\Queue\InteractsWithQueue; | ||||
| use Illuminate\Queue\SerializesModels; | ||||
|  | ||||
| class SendTelegramJob implements ShouldQueue | ||||
| { | ||||
|     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||||
|     protected $telegramId; | ||||
|     protected $text; | ||||
|  | ||||
|     public $tries = 3; | ||||
|     public $timeout = 5; | ||||
|  | ||||
|     /** | ||||
|      * Create a new job instance. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct(int $telegramId, string $text) | ||||
|     { | ||||
|         $this->onQueue('send_telegram'); | ||||
|         $this->telegramId = $telegramId; | ||||
|         $this->text = $text; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Execute the job. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function handle() | ||||
|     { | ||||
|         $telegramService = new TelegramService(); | ||||
|         $telegramService->sendMessage($this->telegramId, $this->text, 'markdown'); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user