Telegram Character limit

Hi,

I’m making a workflow that uses a HTTP request to pull category names and IDS from my website, once it has them it then makes a secondary request to pull names from each category and turn them into a string via text aggregator.

The issue is it then sends the result to a telegram channel, one of the messages it will send is almost 10,000’characters long while telegram itself has a limit of 4096 characters.

I’ve tried to use an iterator to break the text up but I’m struggling to make it work.

Happy to post images of the workflow if someone could shed some insight as this is my first make project.

Hi @jamie3 and welcome to Make!

What type of iterator did you use? Yes, sharing a screen shot of the workflow but, especaially, the input and output bundles can be useful.

I suspect what you could do is split the work in multiple modules and use multiple telegram modules to send more than one message instead of trying to put everything in a single message.

And I would also check to see if it’s possible to send a first message with fewer than 4K characters, then send the rest of the messages as reples in the thread of the first message.

L

Welcome to the Make community!

You can use the built-in function substring together with multiple send modules.

e.g.:

{{ substring(1.text; 0; 4096) }}

{{ substring(1.text; 4096; 8192) }}

{{ substring(1.text; 8192; 12288) }}

etc.

For more information, see the function documentation in the Help Center.

Hope this helps! Let me know if there are any further questions or issues.

@samliew