|
|
@@ -4,6 +4,8 @@ namespace App\Services;
|
|
|
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
|
|
use Endroid\QrCode\Builder\Builder;
|
|
|
use Endroid\QrCode\Writer\PngWriter;
|
|
|
+use Telegram\Bot\Api;
|
|
|
+use App\Models\Config;
|
|
|
|
|
|
class BaseService
|
|
|
{
|
|
|
@@ -113,4 +115,27 @@ class BaseService
|
|
|
}
|
|
|
return $arr;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description: 实例化TG
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public static function telegram()
|
|
|
+ {
|
|
|
+ return app(Api::class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description: 群组通知
|
|
|
+ * @param {*} $key
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public static function bettingGroupNotice($text)
|
|
|
+ {
|
|
|
+ $bettingGroup = Config::where('field', 'betting_group')->first()->val;
|
|
|
+ self::telegram()->sendMessage([
|
|
|
+ 'chat_id' => $bettingGroup,
|
|
|
+ 'text' => $text
|
|
|
+ ]);
|
|
|
+ }
|
|
|
}
|