Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot does not handle max message length (65k chars) #11

Open
nickvergessen opened this issue Aug 15, 2023 · 1 comment
Open

Bot does not handle max message length (65k chars) #11

nickvergessen opened this issue Aug 15, 2023 · 1 comment

Comments

@nickvergessen
Copy link
Member

Could happen in very big calls

@nickvergessen
Copy link
Member Author

Should chunk the string at 60k chars and then just send multiple messages in

$summary = $this->summaryService->summarize($server, $data['target']['id'], $data['target']['name'], $lang);
if ($summary !== null) {
$body = [
'message' => $summary['summary'],
'referenceId' => sha1($random),
'replyTo' => sha1($random),
];
if (!empty($summary['elevator'])) {
$body['replyTo'] = $summary['elevator'];
}
// Generate and post summary
$this->sendResponse($server, $secret, $body, $data);
}

follow up chunks should quote the previous chunk, to ensure the order of them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant