ChatThread unstable
Addresses for chat threads.
A ChatThread names a channel, a thread or a direct conversation on one
platform. The address itself does not say which of the three it is:
ChatEvent.MessageCreated.kind and Chat.getThread do. The id is opaque
to the core and owned by the platform's adapter.
Comparisons
Constructors
Converting
fromString
unstableParses a {platform}:{id} string into a thread address.
Details
The platform is everything before the first :, so an id may contain
:. Both parts must be non-empty, otherwise the result is None.
See
- toString for the inverse
Signature
declare function fromString(value: string): Option<{ readonly id: string; readonly platform: string;}>Formats a thread address as {platform}:{id}.
When to use
Use to build session keys, entity ids and URLs from an address.
Gotchas
The format is frozen once released, because consumers persist it.
See
- fromString for the inverse
Signature
declare function toString(thread: { readonly id: string; readonly platform: string;}): stringModels
The address messages go to: a channel, a thread or a direct conversation on one platform.
Signature
type ChatThread = typeof ChatThread.TypeSchemas
ChatThread
unstableSchema for the address messages go to: a channel, a thread or a direct conversation on one platform.
Details
id is opaque to the core and owned by the adapter. Slack's is
{team}/{channel} or {team}/{channel}/{thread_ts}, Discord's is the
channel snowflake.
Signature
declare const ChatThread: Struct<{ readonly id: String; readonly platform: String;}>FromString
unstableSchema that decodes a {platform}:{id} string into a ChatThread and
encodes it back.
Gotchas
The string format is frozen once released, because consumers persist it.
Signature
declare const FromString: Schema.Codec<ChatThread, string>