straight-wolf-37371
07/26/2023, 2:38 PMrich-oxygen-43707
07/26/2023, 3:02 PMstraight-wolf-37371
07/26/2023, 5:22 PMstraight-car-70922
07/28/2023, 5:05 PMstraight-wolf-37371
07/28/2023, 5:51 PMstraight-car-70922
07/28/2023, 6:03 PMstraight-wolf-37371
07/28/2023, 6:20 PMfamous-zoo-73118
07/28/2023, 7:37 PMfamous-zoo-73118
07/28/2023, 7:40 PMjs
window.botpressWebChat.sendPayload({type:'text', text:"WS1"})
... where WS1
is an internal code for your website. Then in the start node of your bot you can check if the incoming message matches one of the internal codes you define.
Not the most elegant solution, but should work for now while this is not available as an official feature.~~
Please see my revised answer below for a better implementation of this solution:
https://discord.com/channels/1108396290624213082/1133770315873398794/1136041731280863434straight-car-70922
07/28/2023, 9:18 PMstraight-car-70922
07/28/2023, 9:49 PMfew-helicopter-78102
08/01/2023, 12:40 PMevent.payload.text === 'start'
Is this the right syntax to check in the botpress triggers to initiate the conversation?famous-zoo-73118
08/01/2023, 8:58 PMevent.payload.yourCustomAttribute
famous-zoo-73118
08/01/2023, 9:04 PM.sendEvent()
as it won't appear as if the user sent a message. So, from the page the webchat is embedded on, you can call:
js
window.botpressWebChat.sendEvent({ type:'trigger', websiteCode:"WS1" })
And then in your bot just add an Event > Message from channel card into your workflow, then in that card select the "Trigger" option from the "Trigger On" dropdown, and then connect a new node to that trigger and you can now use the event.payload.websiteCode
variable to know which the code of the website your bot was opened on, so you could add an Execute Code card there with this code:
js
session.websiteCode = event.payload.payload.websiteCode
And then anywhere in your bot you can simple use the session.websiteCode
variable to know which website your bot is running on 🚀famous-zoo-73118
08/01/2023, 9:06 PMhttps://cdn.discordapp.com/attachments/1133770315873398794/1136042350825701537/image.png▾
famous-zoo-73118
08/01/2023, 9:20 PMhttps://cdn.discordapp.com/attachments/1133770315873398794/1136045815673143337/image.png▾
early-train-33247
08/03/2023, 11:33 PM