mirror of
https://github.com/MrSedan/neuro-reply-bot-reworked.git
synced 2026-01-14 21:49:42 +03:00
Finally fixed media groups
This commit is contained in:
@@ -33,4 +33,3 @@ class Image(ApiMethod):
|
||||
data = await response.json()
|
||||
if 'statusCode' in data:
|
||||
raise Exception(data['message'])
|
||||
return data['created']
|
||||
|
||||
@@ -57,9 +57,9 @@ class Post(ApiMethod):
|
||||
return neuroTypes.Post.from_dict(data)
|
||||
|
||||
async def get_by_media_group_id(self, media_group_id: str):
|
||||
response = requests.get(
|
||||
self.api_url+f'/post/get-by-media-group-id/{media_group_id}')
|
||||
data = response.json()
|
||||
async with ClientSession() as session:
|
||||
response = await session.get(self.api_url+f'/post/get-by-media-group-id/{media_group_id}')
|
||||
data = await response.json()
|
||||
if 'statusCode' in data:
|
||||
raise Exception(data['message'])
|
||||
return neuroTypes.Post.from_dict(data)
|
||||
|
||||
@@ -34,5 +34,4 @@ class Post(ApiModel):
|
||||
obj = super().to_dict()
|
||||
obj['message_entities'] = json.dumps(obj['message_entities'])
|
||||
obj['media_group_id'] = str(obj['media_group_id'])
|
||||
print(obj)
|
||||
return obj
|
||||
Reference in New Issue
Block a user