Issue with message.receive event .
# 🤝help
a
i have implemented the message.receive event as it is suggested in the documentation and it is not working. https://botpress.com/docs/developers/webchat/controlling-webchat-using-js/ @bumpy-butcher-41910 @fresh-fireman-491
f
It should be MESSAGE.RECEIVED not TRIGGER window.botpressWebChat.onEvent( (event) => { if (event.type === 'MESSAGE.RECEIVED') { console.log('A new message was received!') } }, ['MESSAGE.RECEIVED'] )
Not sure if xx in event.type == 'xx' have to be caps but I would do it since it's like that in the docs
I would create 2 separate onEvent. One for trigger and one for the message received
g
also better to put === instead of 2 I think
a
@fresh-fireman-491 @glamorous-guitar-39983 it is still not working he is my file and my bot
f
Hey there, I would start out by trying to implement what I said here https://discord.com/channels/1108396290624213082/1217195843325530215/1217208652814090363. Let me know if that works 🙂
g
Also I dont think you should put console.log before the if statement
11 Views