Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. from vk_api import VkApi
  2.  
  3. TOKEN = ""
  4.  
  5. OWNER_ID = 0
  6. POLL_ID = 0
  7.  
  8. vk = VkApi(TOKEN)
  9.  
  10. answers_ids = vk("polls.getById", owner_id=OWNER_ID, poll_id=POLL_ID)['answers']
  11.  
  12. poll_answers = vk("polls.getVoters", owner_id=OWNER_ID, poll_id=POLL_ID, answer_ids=",".join(answers_ids))
  13.  
  14. ansv_users = []
  15.  
  16. for ansv in poll_answers:
  17.     ansv_users.extend(ansv['users']['items'])
  18.  
  19. # DO SOME WITH ansv_users
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement