Выдают ошибку, вот скрипт
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);
Сама Ошибка
(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 rejecti
on. 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)