|
|
@@ -8,6 +8,8 @@ use Telegram\Bot\Api;
|
|
|
use App\Models\Config;
|
|
|
use Telegram\Bot\FileUpload\InputFile;
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
+use App\Jobs\SendTelegramMessageJob;
|
|
|
+use App\Jobs\SendTelegramGroupMessageJob;
|
|
|
|
|
|
class BaseService
|
|
|
{
|
|
|
@@ -166,6 +168,18 @@ class BaseService
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description: 异步群组通知
|
|
|
+ * @param {string} $text 通知内容
|
|
|
+ * @param {array} $keyboard 操作按钮
|
|
|
+ * @param {*string} $image 图片
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public static function asyncBettingGroupNotice($text ,$keyboard = [], $image = '' ,$isTop = false)
|
|
|
+ {
|
|
|
+ SendTelegramGroupMessageJob::dispatch($text ,$keyboard ,$image ,$isTop);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @description: 发送消息
|
|
|
* @param {string} $chatId 聊天ID
|
|
|
@@ -193,6 +207,19 @@ class BaseService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description: 异步发送消息
|
|
|
+ * @param {string} $chatId 聊天ID
|
|
|
+ * @param {string} $text 消息内容
|
|
|
+ * @param {array} $keyboard 操作按钮
|
|
|
+ * @param {*string} $image 图片
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public static function asyncSendMessage($chatId ,$text ,$keyboard = [] ,$image = '')
|
|
|
+ {
|
|
|
+ SendTelegramMessageJob::dispatch($chatId ,$text ,$keyboard ,$image);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @description: 弹窗提示
|
|
|
* @param {*} $memberId
|