notmarek / BeFake

BeReal Python API wrapper
132 stars 29 forks source link

Assertion error while calling bf.post_realmoji #106

Closed ohld closed 1 year ago

ohld commented 1 year ago

My code which I used to reproduced the issue:

!git clone https://github.com/notmarek/BeFake/
from BeFake.BeFake.BeFake import BeFake

bf = BeFake()
bf.load()
bf.save()

posts = bf.get_friends_feed()  # worked well btw
post = posts[0]
res = bf.post_realmoji(post.id, post.user.id, "happy")

Stacktrace:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/var/folders/2f/y_nf61x53hg2d7sft2304_dr0000gn/T/ipykernel_33095/3818675105.py in <cell line: 3>()
      1 posts = bf.get_friends_feed()
      2 post = posts[0]
----> 3 res = bf.post_realmoji(post.id, post.user.id, "happy")

~/Documents/researches/bereal/BeFake/BeFake/BeFake.py in post_realmoji(self, post_id, user_id, emoji_type)
    512             "emoji": emojis[emoji_type]
    513         }
--> 514         res = self.api_request("put", f"/content/realmojis", params=payload,
    515                                json=json_data)
    516         return res

~/Documents/researches/bereal/BeFake/BeFake/BeFake.py in api_request(self, method, endpoint, **kwargs)
    125 
    126     def api_request(self, method: str, endpoint: str, **kwargs) -> dict:
--> 127         assert not endpoint.startswith("/")
    128         res = self.client.request(
    129             method,

AssertionError: