Answer the question
In order to leave comments, you need to log in
How to make the bot, when receiving a group wall, throw a random picture from it?
vk.updates.hear(/^\лоли\s*$/i, async (context) => {
// Получаем стену рандомного паблика
let { items } = vk.api.call('wall.get',
{
domain: getRandomElement(["lolyashii"]),
offset: 1,
count: 100
});
let item = getRandomElement(items);
item = item.attachments[0].photo;
await context.send({
attachment: "photo" + item.owner_id + "_" + item.id
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question