Ken 1 week ago
parent
commit
22fc6c9524
1 changed files with 6 additions and 5 deletions
  1. 6 5
      app/Services/BaseService.php

+ 6 - 5
app/Services/BaseService.php

@@ -200,22 +200,23 @@ class BaseService
 
         $bettingGroup = Config::where('field', 'betting_group')->first()->val;
         $array = explode("\n", $text);
+        foreach ($array as &$line) $line .= "\n";
         $texts = [];
         foreach ($array as $item) {
             if (count($texts) == 0) {
-                $texts[] = $item . "\n";
+                $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 . "\n";
+                        $texts[0] .= $item;
                     } else {
-                        $texts[] = $item . "\n";
+                        $texts[] = $item;
                     }
                 } else {
-                    $texts[count($texts) - 1] .= $item . "\n";
+                    $texts[count($texts) - 1] .= $item;
                 }
             } else {
-                $texts[] = $item . "\n";
+                $texts[] = $item;
             }
         }
         foreach ($texts as $index => $item) {