Answer the question
In order to leave comments, you need to log in
Error for element in updates: TypeError: 'module', how to fix?
import data
import requests
import updates
token = ''
data = requests.get('https://api.vk.com/method/messages.getLongPollServer',
params={'access_token': token, 'v': 5.80}).json()['response']
while True:
response = requests.get('https://{server}?act=a_check&key={key}&ts={ts}&wait=20&mode=2&version=2'.format(server=data['server'], key=data['key'], ts=data['ts'])).json()
if updates:
for element in updates:
print(element)
data['ts'] = response['ts']
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