Botpress server v11 event not going out dialog engine


#1

Hello, i am developing a module that receives post request, and send event to botpress.

I’ve created a outgoing middleware with order -1, just to log the event and send to next middleware, but after i send a incoming event nothing happens. If i change the channel to ‘web’ the event go out normally. Can it be something hardcoded?

Event example:

const event = bp.IO.Event({
botId:‘welcome-bot’,
channel: ‘test’,
direction: ‘incoming’,
payload: {text:‘hi’,type:‘text’},
target: ‘userid01’,
type: ‘text’
})
bp.events.sendEvent(event)

My log middleware

bp.events.registerMiddleware({
description: ‘log middleware’,
direction: ‘outgoing’,
handler: (e,n) => {console.log(e);n()},
name: ‘test.logmessages’,
order: -1
})