MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / delete_comment

Method delete_comment

scratchattach/site/user.py:980–994  ·  view source on GitHub ↗

Deletes a comment by its ID. You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_user` Args: comment_id: The id of the comment that should be deleted

(self, *, comment_id)

Source from the content-addressed store, hash-verified

978 )
979
980 def delete_comment(self, *, comment_id):
981 """
982 Deletes a comment by its ID. You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_user`
983
984 Args:
985 comment_id: The id of the comment that should be deleted
986 """
987 self._assert_permission()
988 with requests.no_error_handling():
989 return requests.post(
990 f"https://scratch.mit.edu/site-api/comments/user/{self.username}/del/",
991 headers=headers,
992 cookies=self._cookies,
993 data=json.dumps({"id": str(comment_id)}),
994 )
995
996 def report_comment(self, *, comment_id):
997 """

Callers 2

find_username_from_idMethod · 0.95
deleteMethod · 0.45

Calls 3

_assert_permissionMethod · 0.95
postMethod · 0.80
no_error_handlingMethod · 0.45

Tested by

no test coverage detected