Answer the question
In order to leave comments, you need to log in
How to make js request result in one line?
let noft = await vk.call('messages.getConversationMembers', {
peer_id: msg.message.peer_id,
fields: 'id, first_name',
group_id: 193658885
});
noft.items.forEach(element => {
if (element.member_id > 0){
console.log(element.member_id)
// messagesend('[id' + element.member_id + '|@]')
}
});
Answer the question
In order to leave comments, you need to log in
const noft = await vk.call('messages.getConversationMembers', {
peer_id: msg.message.peer_id,
fields: 'id, first_name',
group_id: 193658885
});
const longString = noft.items.filter(item => (item.member_id > 0))
.map(item => `[id${item.member_id}|@]`)
.join(' ');
console.log(longString);
// [id590120892|@] [id299403203|@] [id102021723|@]
// ...
I haven't tested, but something like this
let noft = await vk.call('messages.getConversationMembers', {
peer_id: msg.message.peer_id,
fields: 'id, first_name',
group_id: 193658885
});
noft.items.forEach(element => {
if (element.member_id > 0){
console.log("[id" + element.member_id.join('') + '|@]')
// messagesend('[id' + element.member_id + '|@]')
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question