def get_last_th_msgs(peer_id: int, api: VkApi) -> List[dict]: return api.exe('''return (API.messages.getHistory({"peer_id":"%(peer)s", "count":"200", "offset":0}).items) + (API.messages.getHistory({"peer_id": "%(peer)s", "count":"200", "offset":200}).items) + (API.messages.getHistory({"peer_id": "%(peer)s", "count":"200", "offset":400}).items) + (API.messages.getHistory({"peer_id": "%(peer)s", "count":"200", "offset":600}).items) + (API.messages.getHistory({"peer_id": "%(peer)s", "count":"200", "offset":800}).items);''' % {'peer': peer_id})
def get_msgs(peer_id, api: VkApi, offset=0): return api.exe('''return (API.messages.getHistory({"peer_id":"%s", "count":"200", "offset":"%s"}).items) + (API.messages.getHistory({"peer_id": "%s", "count":"200", "offset":"%s"}).items);''' % (peer_id, offset, peer_id, offset + 200))