https://discord.gg/botpress logo
const trustKeywords = ['trust', 'How do I trust yo...
# 💻developers
s
const trustKeywords = ['trust', 'How do I trust you', 'why should I trust you'] const message = event.preview console.log("Message caught in hook is ", message) // Check if the message contains trust-related keywords if (trustKeywords.some(keyword => message.toLowerCase().includes(keyword.toLowerCase()))) { // Store the current flow or node name so we can go back later event.state.session.lastCard = event.state.conversation.currentNode console.log("Session saved as ", event.state.session.lastCard) event.state.session.gotoFlow = 'Trust Handler Workflow' } // Return void - no action directly returned in the hook function return