Skip to content

Commit

Permalink
Adding ability to cast to channels (#603)
Browse files Browse the repository at this point in the history
* Adding ability to cast to channels

* Fixing code style
  • Loading branch information
web3d3v authored Oct 19, 2023
1 parent 3d13fae commit b66f4db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion farcaster/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,22 @@ def post_cast(
text: str,
embeds: Optional[List[str]] = None,
parent: Optional[Parent] = None,
channel_key: Optional[str] = None,
) -> CastContent:
"""Post a cast to Farcaster
Args:
text (str): text of the cast
embeds (Optional[List[str]], optional): list of embeds, defaults to None
parent (Optional[Parent], optional): parent of the cast, defaults to None
channel_key (Optional[str], optional): channel of the cast, defaults to None
Returns:
CastContent: The result of posting the cast
"""
body = CastsPostRequest(text=text, embeds=embeds, parent=parent)
body = CastsPostRequest(
text=text, embeds=embeds, parent=parent, channel_key=channel_key
)
response = self._post(
"casts",
json=body.model_dump(by_alias=True, exclude_none=True),
Expand Down
1 change: 1 addition & 0 deletions farcaster/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ class CastsPostRequest(BaseModel):
text: str
embeds: Optional[List[str]] = None
parent: Optional[Parent] = None
channel_key: Optional[str] = None


class CastsPostResponse(BaseModel):
Expand Down

0 comments on commit b66f4db

Please sign in to comment.