Unable to Trigger Proactive Message On Bot Studio

Hello Botpress Community,

I’ve been working on setting up a proactive message in my Botpress bot, but have run into a few issues.

The main goal is to have my bot send a proactive message 5 seconds after loading the page on my Squarespace website. I’m using the botpressWebChat.sendEvent function from the Botpress webchat API, with a type of ‘proactive-trigger’. The intention is to catch this event in a Before Incoming Message hook from the dashboard and respond with a custom message.

However, I’m encountering several issues:

  1. The ‘proactive-trigger’ event seems to be getting treated as a user message, rather than a special event. I understand I should be able to use event.setFlag(bp.IO.WellKnownFlags.SKIP_DIALOG_ENGINE, true) to indicate that this event should not be processed as a user message, but the setFlag method does not seem to exist on the event object in my version of Botpress.
  2. I’m also having trouble determining the correct values for target and threadId when trying to create an eventDestination object in my before_incoming_middleware hook. In my event object, there are properties like userId and conversationId, but no target or threadId.

I would appreciate any guidance on how to handle these issues. Is there an updated method for sending proactive messages or an alternative to the setFlag method? Also, could you advise on how to determine the correct values for target and threadId in the current version of Botpress?

Thank you for your assistance.

Isaac

Hi @isaachouseholder ,

This is obsolete; we are working on an event-driven trigger that should cover your above needs.

Stay tuned!

Thank you for the info Bassam! I am working on integrating it at the moment. Is there any manual code I can write so that I can trigger it for the time being?

It is very obsolete code and not optimal. If you are still interested, please contact me in the live-chat, it will be easier for back-and-forth trials.

Hi Bassam! How do I access the live-chat?

Hey @isaachouseholder ,

Here, in the studio.