Telegram - Bad Request: message is too long

I use an n8n workflow to forward E-Mails via the IMAP Reader to Telegram.

Sometimes an E-Mail is too long which causes the Telegram node to throw an error.

Is there a way how I can limit the characters/cut it off before the message is sent to the Telegram node so that the message stays inside the limit?

I already tried to add slice, but then I get [object Object] in telegram instead of the E-Mail message. O.o

{{$node["markup"].json["markuptextPlain"].slice(0, 100)}}

Hi @cholzer79, how does the data looking from your markup node look like and how is your Telegram node set up? Is there a chance markuptextPlain isn’t a string (in which case slice would not return a string)?

ah dang, you are right. I sliced off a part of my ‘markup’ function output which telegram did not like.
'My fault. XD
I fixed it now and works like a charm!

1 Like

Nice, glad to hear! Many thanks for confirming :slight_smile: