1

How can I fix this error in JS?

error_code: 403, description: 'Forbidden: bot was blocked by the user'

This initial code

bot.start( (ctx) => {
    console.log(ctx.chat.id)
    if (newClient(ctx.message.chat.id)) {
        createLog(ctx.message.chat.id)
        ctx.reply("Message")
    } else {
        ctx.reply("Message")
    }
})
0stone0
  • 34,288
  • 4
  • 39
  • 64

1 Answers1

1

The error message obviously says what happened; The bot was blocked by the user.

To fix that, you have to add a condition that checks if the user blocked the bot. Or the user should unblock the bot.

Usitha Indeewara
  • 870
  • 3
  • 10
  • 21