T
T
TVgameYT2021-08-11 21:25:27
Bots
TVgameYT, 2021-08-11 21:25:27

ExecuteError: Code #901 - Can't send messages for users without permission how to get permission?

THIS IS AN ERROR THAT COMES OUT DURING THE OUTPUT, although the output successfully writes in a conversation that the person has withdrawn but does not write to him in the PM

(node:28752) UnhandledPromiseRejectionWarning: ExecuteError: Code №901 - Can't send messages for users without permission
    at /storage/emulated/0/botVKC/double/node_modules/vk-io/lib/index.js:837:73
    at Array.map (<anonymous>)
    at API.callMethod (/storage/emulated/0/botVKC/double/node_modules/vk-io/lib/index.js:837:57)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:28752) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)


context.session.user.balance = 0
        await context.session.user.save()
        try {
          await vkc.api.sendPayment(context.senderId, balance * 1000, true)
          const message = oneLine`
             [id${context.senderId}|${context.session.user.firstName}],
            мы успешно отправили тебе ${utils.split(balance)} VKC.
          `

vk.api.messages.send({
      peer_id: ид группы,
      message: `Юзер [id${context.senderId}|${context.session.user.firstName}], вывел баланс на сумму - ${utils.split(balance)}`
    })
          await context.send(message, {
            keyboard: defaultKeyboard,
            disable_mentions: true,
          })} catch (_) {
          const message = oneLine`
             [id${context.senderId}|${context.session.user.firstName}],
            возникла ошибка при отправке ${utils.split(balance)} VKC, свяжись с администратором.
          `

          await context.send(message, {
            keyboard: defaultKeyboard,
            disable_mentions: true,
          })
        }

        removeFromArray(inProgress, context.senderId)

        return context.scene.leave()
      },
    ],
  ),
)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question