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)
| 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 | """ |
no test coverage detected