@TVgameYT

ExecuteError: Code №901 — Can't send messages for users without permission как получить разрешение?

ЭТО ОШИБКА КОТОРАЕТ ВЫЛЕЗАЕТ ПРИ ВЫВОДЕ, хотя выводит успешно пишет в беседе что человек вывел но ему же в лс не пишет
(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()
      },
    ],
  ),
)
  • Вопрос задан
  • 113 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы