Repository: AzuraCast/AzuraCast (language: php)

Issue:
GroupMe Webhook Character Limit
### Installation Method

Docker Installation

### AzuraCast Release Channel

Rolling Release Channel

### Current AzuraCast Version

_No response_

### What happened?

GroupMe has a character limit of 1000 for message text per message POST. I intend on submitting a PR to address this at some point soon.

To address the issue, I'm planning to detect message bodies that exceed this limit and then chunk them into segments that fit. If a message is segmented, a prefix label will be included to indicate that a message is a part of a larger body, e.g. `(2/3` for segment two of three total. 

### Relevant log output

_No response_


Discussion / hints:

Fix patch:
diff --git a/backend/src/Webhook/Connector/GroupMe.php b/backend/src/Webhook/Connector/GroupMe.php
index 46eee29b537..2f33f2dbba7 100644
--- a/backend/src/Webhook/Connector/GroupMe.php
+++ b/backend/src/Webhook/Connector/GroupMe.php
@@ -47,26 +47,32 @@ public function dispatch(
 
         $webhookUrl = $apiUrl . '/bots/post';
 
-        $requestParams = [
-            'bot_id' => $botId,
-            'text' => $messages['text'],
-        ];
+        $text = $messages['text'];
+        $chunks = str_split($text, 1000);
 
-        $response = $this->httpClient->request(
-            'POST',
-            $webhookUrl,
-            [
-                'headers' => [
-                    'Content-Type' => 'application/json',
-                ],
-                'json' => $requestParams,
-            ]
-        );
+        foreach ($chunks as $chunk) {
+            $requestParams = [
+                'bot_id' => $botId,
+                'text' => $chunk,
+            ];
 
-        $this->logHttpResponse(
-            $webhook,
-            $response,
-            $requestParams
-        );
+            $response = $this->httpClient->request(
+                'POST',
+                $webhookUrl,
+                [
+                    'headers' => [
+                        'Content-Type' => 'application/json',
+                    ],
+                    'json' => $requestParams,
+                ]
+            );
+
+            $this->logHttpResponse(
+                $webhook,
+                $response,
+                $requestParams
+            );
+            usleep(100000); // Delay to prevent sending out of order
+        }
     }
 }


Test patch: