K
K
kitmat2019-09-20 15:14:53
JavaScript
kitmat, 2019-09-20 15:14:53

I can't figure out why it's giving an error?

They give an error, here is the script

setInterval(async () => {
let top = []
users.map(user=>{
if(user.RIGHT < 4) {
top.push({id: user.id, uid: user.uid, tag: user.tag, rating: user.rating})
}
})
top.sort((a, b)=>{
return b.rating - a.rating
})
let script = {
title: 'Лучшие игроки',
title_url: "vk.com/id193221973",
head: [{
text: 'Ник игрока'
}, {
text: 'Рейтинг',
align: 'right'
}],
body: [],
more: "Написать создателю",
more_url: "vk.com/im?sel=193221973"
}
for (let g = 0; g < 10; g++) {
if (top.length > g) {
script.body.push([{
icon_id: `id${top[g].id}`,
text: `${users[top[g].uid].tag}`,
url: `vk.com/id${top[g].id}`
}, {
text: `${utils.sp(users[top[g].uid].rating)}`
}])
}
}
let widget = new VK;
widget.setOptions({token: 'токен вставлен мой' });
widget.api.appWidgets.update({code: `return ${JSON.stringify(script)};`, type: 'table'})
}, 30000);

Error itself
(node:35539) UnhandledPromiseRejectionWarning: APIError: Code #27 - Grou
p authorization failed: group revoke access for this token.
at API.callMethod (/root/PB/node_modules/vk-io/lib/index.js:1229:33)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:35539) 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(). (rejection id: 15)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Stadnik, 2019-10-22
@nuriboy

He can't authenticate with the group token

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question