Sets the user's profile picture. You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_user`
(self, image: bytes)
| 760 | return commons.parse_object_list(_projects, project.Project, self._session) |
| 761 | |
| 762 | def set_pfp(self, image: bytes): |
| 763 | """ |
| 764 | Sets the user's profile picture. You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_user` |
| 765 | """ |
| 766 | # Teachers can set pfp! - Should update this method to check for that |
| 767 | # self._assert_permission() |
| 768 | requests.post( |
| 769 | f"https://scratch.mit.edu/site-api/users/all/{self.username}/", |
| 770 | headers=self._headers, |
| 771 | cookies=self._cookies, |
| 772 | files={"file": image}, |
| 773 | ) |
| 774 | |
| 775 | def set_bio(self, text): |
| 776 | """ |