I am writing a script parser in Python that should collect the entire message history from the conversation. I plan to implement this idea through the execute method (library "vk") and there was a question about passing arguments to the execute code. Can I somehow transfer the offset parameter to code?
reponse_get_history = apivk.messages.getHistory(peer_id=2000000590,offset=0,count=200,v=5.92) response_execute = [] count_message = 0 while count_message < reponse_get_history["count"]: code = ''' var i = 0; var response_get_history = []; var response_get_history_message = []; var offset = 0; while (i < 25) { response_get_history = response_get_history_message + API.messages.getHistory({"peer_id": 2000000590, "offset": offset, "count": 200}); response_get_history_message = response_get_history_message + response_get_history.items; i = i + 1; offset = offset + 200; } return response_get_history_message; ''' response_execute = response_execute + apivk.execute(code=code, v=5.92) count_message = count_message + len(response_execute) print(response_execute) time.sleep(50)