Errors

Common errors you may encounter while developing your applications

Code 100

{
  error: `You must first log in by scanning the qr code to be able to use this functionality.`,
  docs: `https://builderbot.vercel.app/errors`,
  code: `100`,
}

This error occurs when you're using handleCtx, which is a method responsible for handling and checking if the session instantiation is correct. Possible causes of this error are:

  • Make sure you have an active session
  • Make sure you have scanned the QR code to start the session

If the error persists after ensuring you have an active session, then the problem is being generated by the logic you're creating. Try wrapping the part of the logic that's causing the error in a try-catch block and see if you can identify the error.

  provider.server.post('/v1/register', handleCtx(async (bot, req, res) => {
    try {
      const { number, name } = req.body
      await bot.dispatch('EVENT_REGISTER', { from: number, name })
      return res.end('trigger')
    } catch (error) {
      console.log(error)
      return res.end(error)
    }
  }))

Guides

My first chatbot

Learn how build your first chatbot in few minutes

Read more

Concepts

Understand the essential concepts for building bots

Read more

Add Functions

The key to learning how to write flows is add-functions.

Read more

Plugins

Unlimitate and start implementing the community plugins.

Read more

Resources

Modularize

Learn how to modularise flows so that you can have a more maintainable bot.

Send Message

How to send a message via HTTP to start conversations, you can send multimedia as well.

Dockerizer

A good practice is to dockerise your bots to make them more maintainable and effective.

Events

Learning about events will make us more fluent when creating chatbots.