예제 #1
0
파일: api_utils.py 프로젝트: Godikbot1/IDEA
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})
예제 #2
0
파일: api_utils.py 프로젝트: Godikbot1/IDEA
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))