Communication between Module and Bot


#1

Hello i am new to Botpress had a question about the communication between an module and Bot.

I have made an module that wil be used as an webhook. What i can’t figure out is how to get the data posted in my webhook to my Bot.

In my module i have an function that posts in my webhook :
router.post(’/message’, (req, res, next) => {
//after data post send message to bot
}

Does anyone know the options i can use. Would be gratefull


#2

Hello, please, can anybody help me? I am trying to send data that I receive via my Express router in a created module, to my main bot project, so I can display them. Do I need to use middleware for that or can I use some sort of events

Any help would be appreciated


#3

@Soufyanbreda I’m not quite getting the question. Are you getting any errors or smth?


#4

Thanks for the reply i now know i can use bp.middlewares.sendIncoming to send an message.