https://discord.gg/botpress logo
How to get rid of "\n" in the autonomous node's re...
# 🤝help
f
Hello, as the title suggests, I have an autonomous node, which does what it should and works perfectly fine, except for one thing: The "\n" are visible in the reply instead of a new line. Please find a screenshot of such a reply attached. These is an excerpt of the instructions, where I describe the formatting: "Since you are communicating on WhatsApp, you must not use markup, but the WhatsApp formatting rules. These are: italic; bold; - List; 1. Numbered List. Do NOT use “\n”!" As you can see, I have already tried prohibiting the use of "\n", but the bot seems to ignore it. Thanks for any hints! https://cdn.discordapp.com/attachments/1359877300207882491/1359877600302076016/image.png?ex=67f91435&is=67f7c2b5&hm=fd192afa414a156f151d9ea265c29284930fb2b6b920e2aef108df842f8abfef&
b
Hello use   instead of /n
f
Thank you for the suggestion! I've added this to the instructions. Unfortunately, it leads to the same result.
b
For me it work, here an example put in "raw input" card :
Copy code
👋 Bonjour, je suis Muvy !
Dites-moi ce que vous cherchez pour votre séjour ✨
 
📍 La ville
💸 Votre budget par nuit
🌟 Le nombre d’étoiles
✅ Les services importants pour vous (Wi-Fi, piscine, parking, etc.)
👫 Le nombre de personnes
📅 Les dates de séjour
 
Par exemple :
"Je cherche un hôtel à Ajaccio pour 2 personnes, avec Wi-Fi et petit-déjeuner inclus, autour de 100€/nuit."
 
Je vous écoute 😊
f
Maya it's because WhatsApp uses different formatting, as compared to webchat.
w
I think the problem is not of AN but chat extensions (whatsapp, telegram, webchat, ...) that should format in the right way.
Try saying AN to remove \n from response or use a Before Outgoing Hook to do it
f
Removing all formatting instructions from the AN seemed to work, though not ideal. I've tried your suggestion using a Hook, but how do I access and change the AN message before outgoing? I've tried the following, but it didn't work:
Copy code
async function hook(outgoingEvent: IO.OutgoingEvent, event: IO.IncomingEvent): Promise<void> {
/** Your code starts below */
  event.preview = event.preview.replace("\n", "")
/** Your code ends here */
}