https://discord.gg/botpress logo
How to use action functions in hooks??
# 🤝help
m
How to use action functions in hooks?? Bot in documentation suggested to use below 👇
Copy code
js
const result = await bp.dialogEngine.invokeAction('your-action-name', { inputVar: value }, event)
when I use them in hooks, looks bp is undefined. Please let me know how can I use the functions defined in actions in hooks to reuse the functions https://cdn.discordapp.com/attachments/1400759446891925645/1400759447089053777/Screenshot_2025-08-01_at_14.06.35.png?ex=688dce65&is=688c7ce5&hm=d11f9d9b335c6c09dce1f8a85f90d72a2005a4ebd02ea4735625d0b37fa6e6d5&
p
You cannot call user defined functions from hooks. You should paste your code within the hooks code editor. Hope this helps!
m
ok thanks