Error while handling request with botpress hello world chatbot

151 views Asked by At

I am new to chatbot and botpress. I have created the simple hello world application by following the botpress documentation.

Here is my sample index.ts

import { Bot, messages } from '@botpress/sdk'

const bot = new Bot({})

bot.message('', async ({ message, client, ctx }) => {
  log.info('Received message', message)

  await client.createMessage({
    conversationId: message.conversationId,
    userId: ctx.botId,
    tags: {},
    type: 'text',
    payload: {
      text: `I'm a stub bot. You said: ${message.payload.text}`,
    },
  })
  console.log('text message sent')
})

export default bot

however, when I run command bp dev and open the browser with link localhost:8075 I get below error

Error while handling request {
  error: '[\n' +
    '  {\n' +
    `    "expected": "'event_received' | 'register' | 'unregister' | 'ping'",\n` +
    '    "received": "undefined",\n' +
    '    "code": "invalid_type",\n' +
    '    "path": [],\n' +
    '    "message": "Required"\n' +
    '  }\n' +
    ']'
}

I have already spent few hours debugging and looking through documentation and resources for this. I was hoping to get the chatbot ui interface where i can test out the hello world program. am I missing something ?? any help or resources would be appreciated.

0

There are 0 answers