Answer the question
In order to leave comments, you need to log in
Why does it output to the console as it should (6 groups), but only 1 group writes to messages?
The code:
cmd.hear(/^(?:1)$/i, async (msg) => {
vk.api.groups.get({
access_token: "",
user_id: ,
extended: 1,
filter: "moder",
}).then(function(res) {
console.log(res)
for (i in res.items) {
return msg.send(`Список групп, в которых данный пользователь является администратором:\n[vk.com/club${res.items[i].id}|${res.items[i].name}]`)
}
})
})
Answer the question
In order to leave comments, you need to log in
Because you have a return in the loop, which immediately completes it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question