|
|
@@ -22,6 +22,7 @@ class SendTelegramGroupMessageJob implements ShouldQueue
|
|
|
public $buttons;
|
|
|
public $image;
|
|
|
public $isTop;
|
|
|
+ public $separator;
|
|
|
|
|
|
/**
|
|
|
* @param string $chatId
|
|
|
@@ -29,19 +30,20 @@ class SendTelegramGroupMessageJob implements ShouldQueue
|
|
|
* @param array $buttons
|
|
|
* @param string|null $image
|
|
|
*/
|
|
|
- public function __construct( $text, $buttons = [], $image = null ,$isTop = false)
|
|
|
+ public function __construct($text, $buttons = [], $image = null, $isTop = false, $separator = "\n")
|
|
|
{
|
|
|
$this->text = $text;
|
|
|
$this->buttons = $buttons;
|
|
|
$this->image = $image;
|
|
|
$this->isTop = $isTop;
|
|
|
+ $this->separator = $separator;
|
|
|
}
|
|
|
|
|
|
public function handle()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
- BaseService::bettingGroupNotice($this->text, $this->buttons, $this->image,$this->isTop);
|
|
|
+ BaseService::bettingGroupNotice($this->text, $this->buttons, $this->image, $this->isTop);
|
|
|
} catch (\Telegram\Bot\Exceptions\TelegramResponseException $e) {
|
|
|
// // 捕获 Too Many Requests
|
|
|
// if (str_contains($e->getMessage(), 'Too Many Requests')) {
|
|
|
@@ -53,7 +55,7 @@ class SendTelegramGroupMessageJob implements ShouldQueue
|
|
|
// // 重试
|
|
|
// $this->handle();
|
|
|
// } else {
|
|
|
- Log::error('Telegram 消息发送失败: '.$e->getMessage());
|
|
|
+ Log::error('Telegram 消息发送失败: ' . $e->getMessage());
|
|
|
// }
|
|
|
}
|
|
|
}
|