1
1
import asyncio
2
- import mimetypes
3
2
import os
4
3
import json
5
4
import logging
8
7
from io import BytesIO
9
8
from asyncio .tasks import Task
10
9
from swibots .types import MediaType
11
- from swibots .errors import CancelError
12
10
from swibots .api .chat .models import (
13
11
Message ,
14
12
GroupChatHistory ,
@@ -368,15 +366,15 @@ async def delete_messages_from_user(
368
366
369
367
async def get_messages_between_users (
370
368
self ,
371
- recipient_id : int ,
369
+ other_user_id : int ,
372
370
user_id : int = None ,
373
371
page_limit : int = 100 ,
374
372
page_offset : int = 0 ,
375
373
) -> List [Message ]:
376
374
"""Get messages between two users
377
375
378
376
Parameters:
379
- recipient_id (``int``): The recipient id
377
+ other_user_id (``int``): The other user id.
380
378
user_id (``int``, *optional*): The user id. Defaults to the current user id.
381
379
page_limit (``int``, *optional*): The page limit. Defaults to 100.
382
380
page_offset (``int``, *optional*): The page offset. Defaults to 0.
@@ -389,17 +387,17 @@ async def get_messages_between_users(
389
387
"""
390
388
data = {
391
389
"pageOffset" : page_offset ,
392
- "pageLimit" : 0 ,
390
+ "pageLimit" : page_limit ,
393
391
}
394
392
395
393
if user_id is None :
396
394
user_id = self .client .user .id
397
395
398
- log .debug ("Getting messages for user %s" , recipient_id )
396
+ log .debug ("Getting messages for user %s" , other_user_id )
399
397
response = await self .client .get (
400
- f"{ BASE_PATH } /{ user_id } /{ recipient_id } ?{ urlencode (data )} "
398
+ f"{ BASE_PATH } /{ user_id } /{ other_user_id } ?{ urlencode (data )} "
401
399
)
402
- return self .client .build_list (Message , response .data [ "messages" ] )
400
+ return self .client .build_list (Message , response .data )
403
401
404
402
async def forward_message (
405
403
self ,
0 commit comments