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:
- 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 thesetFlag
method does not seem to exist on theevent
object in my version of Botpress. - I’m also having trouble determining the correct values for
target
andthreadId
when trying to create aneventDestination
object in mybefore_incoming_middleware
hook. In myevent
object, there are properties likeuserId
andconversationId
, but notarget
orthreadId
.
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