https://discord.gg/botpress logo
Approve messages before sending
# 🤝help
g
Hi, Is there an easy way of requiring every bot message to be approved before sending without modifying every single node ? If not, what do you think would be the best way to do this. We’re just trying to make sure all messages the bot sends to customers will be pre-approved to ensure it doesn’t say anything wrong while in beta. Thanks !
n
You would need to fire webhooks at each step, then run automations to approve each message. This sounds kind of over engineered
g
Thank you for your answer. I guess we’ll just need to test in parallel instead and hope for the best.
o
As mentioned above, have you looked into using hooks? You won't need to recreate this for every node. You can have it before outgoing message and just create 1 hook (create it once and it'll fire before every outgoing message) https://cdn.discordapp.com/attachments/1363689439469109378/1363881641520398386/Screenshot_2025-04-21_at_10.18.01_AM.png?ex=6807a543&is=680653c3&hm=d89e951d8273eb7f3b7212e42cc0062dc97b6dee8d434cb7e5eab7ffeff2e2dd&
However, this will indeed still be a complex process (to then figure out how to manually validate it / send it elsewhere --> to then send it back).
Have you considered having 2 bots (one for prod and one for testing?) and then just test any changes thoroughly on the testing bot before copying to the production bot?
Or just not Publishing any changes until after being done thoroughly testing in the Emulator?
What is your main concern here?
g
Our main concern is avoiding nonsensical answers to questions we didn’t expect. The idea of having to pre-approve every message is so we can rewrite the flow while still running it in production without worrying of wrong answers until we’ve run it long enough without any modification.
c
Is your bot a regular webchat bot, or are you using another channel. Eg. WhatsApp
g
Currently only webchat, but the goal is to use it for other channels as well, mainly Facebook.
o
Then a "After Incoming" hook that checks every message after it has been sent by the user should work for you. You would place the logic for your handling of the message there (depending on how you would like to approve it)
note the last message sent by the user is stored in "event.preview"
3 Views