|
|
@@ -197,25 +197,20 @@ class BaseService
|
|
|
*/
|
|
|
public static function bettingGroupNotice($text, $keyboard = [], $image = '', $isTop = false): void
|
|
|
{
|
|
|
-
|
|
|
$bettingGroup = Config::where('field', 'betting_group')->first()->val;
|
|
|
$array = explode("\n", $text);
|
|
|
foreach ($array as &$line) $line .= "\n";
|
|
|
$texts = [];
|
|
|
+
|
|
|
+ $len = 4096;
|
|
|
+ if (!empty($image)) $len = 1024;
|
|
|
foreach ($array as $item) {
|
|
|
if (count($texts) == 0) {
|
|
|
$texts[] = $item;
|
|
|
- } else if (strlen($texts[count($texts) - 1] . $item) <= 4096) {
|
|
|
- if (!empty($image) && count($texts) == 1) {
|
|
|
- if (strlen($texts[0] . $item) <= 1024) {
|
|
|
- $texts[0] .= $item;
|
|
|
- } else {
|
|
|
- $texts[] = $item;
|
|
|
- }
|
|
|
- } else {
|
|
|
- $texts[count($texts) - 1] .= $item;
|
|
|
- }
|
|
|
+ } else if (strlen($texts[count($texts) - 1] . $item) <= $len) {
|
|
|
+ $texts[count($texts) - 1] .= $item;
|
|
|
} else {
|
|
|
+ $len = 4096;
|
|
|
$texts[] = $item;
|
|
|
}
|
|
|
}
|