mirror of
https://github.com/MrSedan/neuro-reply-bot-reworked.git
synced 2026-01-15 14:09:43 +03:00
Deleted posts command
This commit is contained in:
@@ -111,4 +111,11 @@ class Post(ApiMethod):
|
||||
response = requests.delete(self.api_url+f"/post/delete-post-by-order/{order}")
|
||||
data = response.json()
|
||||
if 'statusCode' in data:
|
||||
raise Exception(data['message'])
|
||||
raise Exception(data['message'])
|
||||
async def get_deleted_posts(self) -> List[neuroTypes.Post]:
|
||||
async with ClientSession() as session:
|
||||
response = await session.get(self.api_url+f'/post/get-deleted')
|
||||
data = await response.json()
|
||||
if 'statusCode' in data:
|
||||
raise Exception(data['message'])
|
||||
return [neuroTypes.Post.from_dict(post) for post in data]
|
||||
|
||||
Reference in New Issue
Block a user