K
K
kalamandi2021-01-06 20:41:11
In contact with
kalamandi, 2021-01-06 20:41:11

If VK returns an error, how to notify the user about this?

If a non-existent id is specified in vk.api.users.get in the user_ids parameter, vk will return an error about this to the user. I need to make it so that if an error occurs, the bot sends a message about this to the user

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
scriptnet hello, 2021-01-07
@scriptnet

vk.api.users.get({user_ids: 123}).catch((err) => {
  message.send(`ой ошибка!`)
  console.error(err)
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question