The {{ $json["textPlain"].substring(0, 100) }} expression used here would read the incoming textPlain value and then shorten the text down to 100 characters. So a possible workflow could look like so:
You can generally run custom code in n8n using the Function and Function Item nodes, but the post you have shared refers to a discord.js library which isn’t included in n8n.
To include external node modules you’d need to install them along with n8n and then allow their usage in the aforementioned nodes using the NODE_FUNCTION_ALLOW_EXTERNALenvironment variable. This would only work if you host n8n yourself.
Alternatively you might want to raise a feature request for adding an “auto-split long messages” option to the n8n Discord node.
In the discord node, how would I add embeds that I recieve from the email to be posted with the discord webhook.
E.g.
I get a notification from Traefik Pilot that tells me if one of my machines connected to it is down and it will send an image that I would like to see in discord in a more smaller format, any way this is possible?
No worries. If your images have a public URL you could just include that URL in your text for the time being. Discord will preview the picture automatically:
What you just said reminded me of another question, since the attachment/images aren’t currently supported, then is it possible that once the email is recieved through IMAP and it contains an image, that would be saved in a certain place and posted in a place like: imgur as private, then something would take the URL of that image and post it along side of the email that is recieved?
E.g.
IMAP = Recieves email with Image
$Example node takes the email image and saves it somewhere.
$Imgur node or something else posts it as private
$Another example node would take the post URL and add it at the bottom of the email text_plain
$Discord Node would take both of these and add them together, then post it.