Answer the question
In order to leave comments, you need to log in
How to send a friend request to a group member via vk_api?
Do I need to query the members via the groups.getMembers method, or what? Preferably with sample code
Answer the question
In order to leave comments, you need to log in
In general, everything was decided by itself
import vk_api
GROUPS_IDS = ('айди групп')
user_ids = api.method('groups.getMembers', {'group_id':random.choice(GROUPS_IDS), 'sort':('id_desc'), 'count':1000})['items']
user = random.choice(user_ids)
api.method('friends.add', {'user_id':user})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question