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

Method set_pfp

scratchattach/site/user.py:762–773  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 1

postMethod · 0.80

Tested by

no test coverage detected