From 24b8db6f6dfe7e78af95d00b5156c8a5e9ee5d50 Mon Sep 17 00:00:00 2001 From: retoor Date: Mon, 6 Jan 2025 19:00:45 +0100 Subject: [PATCH] Delete. --- src/devranta/api.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/devranta/api.py b/src/devranta/api.py index f2f7642..a003bcf 100644 --- a/src/devranta/api.py +++ b/src/devranta/api.py @@ -117,6 +117,17 @@ class Api: return None return obj.get("comment") + + async def delete_comment(self, id_): + response = None + if not await self.ensure_login(): + return False + async with self as session: + response = await session.delete( + url=self.patch_url("comments/" + str(id_)), params=self.patch_auth() + ) + obj = await response.json() + return obj.get("success", False) async def get_profile(self, id_): response = None