Facet detection (rich text)
- atproto_client.utils.facet_detection.detect_facets(text: str) List[Main]
Detect non-
@mentionfacets in the text: links,#tagsand$cashtags.- Parameters:
text β Text to detect facets in.
- Returns:
Detected facets sorted by their position in the text.
- class atproto_client.utils.facet_detection.MentionMatch(handle: str, byte_start: int, byte_end: int)
Bases:
NamedTupleA mention found in the text. The handle is not resolved to a DID.
- handle: str
Handle without the
@.
- byte_start: int
Start of the
@handlein the UTF-8 encoded text (inclusive).
- byte_end: int
End of the
@handlein the UTF-8 encoded text (exclusive).
- atproto_client.utils.facet_detection.detect_mentions(text: str) List[MentionMatch]
Detect mentions (e.g.
@bsky.app) in the text.This function doesnβt make any network requests, so handles are not resolved to DIDs and it canβt tell if they exist.
- Parameters:
text β Text to detect mentions in.
- Returns:
Detected mentions in the order they appear in the text.