https://discord.gg/botpress logo
Breaking Long Messages into shorter ones
# 🤝help
n
Is there a way to break up a longer message of text into shorter messages. I'm currently doing this using an AN but I'm switching to a non-AN system and would want the same to be done. So that it looks like this. https://cdn.discordapp.com/attachments/1395344194410647613/1395344195002175619/Screenshot_2025-07-17_at_12.59.19.png?ex=687a1b0c&is=6878c98c&hm=e1e4a1874556c26d8dd3adbf3d15109b808f6caa246c64fc3c4c4258dfe86333&
Instea of producing a wall of text.
Is there something I can do in the hooks before sending the message out. i.e. break it down somehow and send it as multiple different messages
p
In your no-AN version, how are you going to generate the text?
n
It's already generated
By a simple query KB card
p
Alright I see you can use the execute code card to split it up and display it. Here's how to send messages programmatically:
Copy code
js
client.createMessage({
    conversationId,
    userId: botId,
    tags: {},
    type: 'text',
    payload: {
      text: "Don't forget to drink water!", // Your reminder message
    },
  })
})
n
Thank you so much @prehistoric-airplane-85682
Been trying to do this for months, and I'd only come up with a few patch-job ways of doing it
Much appreciated😃
Tried it out and for some reason it isn't working
@prehistoric-airplane-85682, any thing I may have missed?
p
It works outside of the emulator, only.
n
Ohh, ok