How to send a post with hashtags? #507
-
Hi, I'm trying to create a post with a hashtag, which I think I don't need to do anything special to get to work. But they don't work - the hashtags don't post as hashtags; they are plain text. Example below: bsky_client = Client()
bsky_client.login(bsky_username, bsky_password)
bsky_client.send_post("I love #cats", langs=["en-UK"]) Posts |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, you should work with facets (rich text). Here you can read more about it: https://docs.bsky.app/docs/advanced-guides/post-richtext Here is how to use SDK`s helper to make it easy: from atproto import client_utils
text = client_utils.TextBuilder().text('I love ').tag('#cats', 'cats')
client.send_post(text) Read more about TextBuilder: https://atproto.blue/en/latest/atproto_client/utils/text_builder.html |
Beta Was this translation helpful? Give feedback.
-
Thanks @MarshalX, that works a treat! |
Beta Was this translation helpful? Give feedback.
Hi, you should work with facets (rich text). Here you can read more about it: https://docs.bsky.app/docs/advanced-guides/post-richtext
Here is how to use SDK`s helper to make it easy:
Read more about TextBuilder: https://atproto.blue/en/latest/atproto_client/utils/text_builder.html