Advertisement
Olegos

Get Conversations

Aug 18th, 2020 (edited)
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import vk_api
  3. from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
  4.  
  5. vk_session = vk_api.VkApi(token='сюда токен')
  6. call = vk_session.get_api()
  7. group_id = call.groups.getById()[0]['id']
  8.  
  9. def function(number=0):
  10.     response = call.messages.getConversations(filter='all', count=200, offset=number)
  11.     for i in response['items']:
  12.         print(i['conversation']['peer']['id'])
  13.     if len(response['items']) == 200:
  14.         number += 200
  15.         function(number)
  16.  
  17. function()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement