Properties
string
required
string
required
Methods
add()
send(addMember(users)).
Accepts a single User or id string, or an array of either — batches
land in one provider call. Fire-and-forget.
Universal API; per-platform constraints (e.g. iMessage: remote + group
only — a DM cannot be converted, create a group via space.create)
surface as UnsupportedError from the provider’s send action.
Parameters
MemberInput
required
Returns
Promise<void>
avatar()
send(avatar(input, options?)).
space.avatar("clear")— remove the current avatar.space.avatar("./icon.png")— set from a filesystem path; MIME type is inferred from the extension.space.avatar(new URL("https://…/icon.png"))— fetch the avatar lazily over the network. Bytes stay in memory (safe in read-only environments); MIME type is inferred from the URL pathname extension.space.avatar(buffer, { mimeType })— set from in-memory bytes;mimeTypeis required (enforced at the type level).
UnsupportedError from the provider’s send action.
Parameters
string | URL
required
{ mimeType: string }
Returns
Promise<void>
Parameters
Buffer
required
{ mimeType: string }
required
Returns
Promise<void>
edit()
send(edit(newContent, message)). Accepts Message | undefined so
send results chain without narrowing; an undefined target throws.
Parameters
ContentInput
required
Returns
Promise<void>
getAvatar()
undefined when
the chat has none. The result round-trips into the setter:
space.avatar(res.data, { mimeType: res.mimeType }).
Universal API; per-platform constraints (e.g. iMessage: remote + group
only — a DM throws) surface as UnsupportedError, as do platforms with
no implementation.
Returns
Promise<AvatarData | undefined>
getDisplayName()
undefined when the chat has none — an unnamed group, or a 1:1 chat on a
platform that stores no title for DMs. Round-trips into space.rename().
Universal API; unlike rename the read is not group-only. Per-platform
constraints (e.g. iMessage: remote only) surface as UnsupportedError, as
do platforms with no implementation.
Returns
Promise<string | undefined>
getMembers()
User tagged with
__platform; id is the user’s canonical platform handle (the same
format space.create accepts), so results feed straight back into
add() / remove() / space.create(). Platform extras (e.g.
iMessage’s address/country/service) ride along untyped — use the
platform instance’s getMembers(space) for typed extras.
Universal API; per-platform constraints (e.g. iMessage: remote + group
only — a DM throws) surface as UnsupportedError, as do platforms with
no implementation.
Returns
Promise<User[]>
getMessage()
undefined if the
platform has no way to resolve the id (e.g. cache miss with no by-id
SDK fallback). Used to materialize a Message for APIs that require one,
such as reaction().
Parameters
string
required
Returns
MessageSpace
leave()
send(leaveSpace()). Fire-and-forget.
Universal API; per-platform constraints (e.g. iMessage: remote + group
only) surface as UnsupportedError from the provider’s send action.
Returns
Promise<void>
read()
message, surfacing a read receipt
to the sender where the platform supports one. Sugar for
send(read(message)). Fire-and-forget; only inbound messages can be
marked read.
Granularity is per-platform: WhatsApp Business issues a receipt for
message and everything before it; iMessage (remote) marks the whole
chat read. Platforms with no read-receipt concept for bot conversations
(Telegram, Slack) silently no-op, so the signal is best-effort
everywhere — same contract as startTyping().
Parameters
Returns
Promise<void>
remove()
send(removeMember(users)). Accepts the same input shapes as add.
Fire-and-forget.
Universal API; per-platform constraints (e.g. iMessage: remote + group
only) surface as UnsupportedError from the provider’s send action.
Parameters
MemberInput
required
Returns
Promise<void>
rename()
send(rename(displayName)).
Universal API; per-platform constraints (e.g. iMessage: remote + group
only) surface as UnsupportedError from the provider’s send action.
Parameters
string
required
Returns
Promise<void>
responding()
Parameters
() => T | Promise<T>
required
Returns
Promise<T>
send()
content narrowed to
Reaction) — the handle to unsend() later. Listed before the general
overload so send(reaction(...)) picks it; every other ContentBuilder
fails the ReactionBuilder shape and falls through.
Parameters
ReactionBuilder
required
Returns
MessageSpaceMessage
Parameters
ContentInput
required
Returns
MessageSpace
Parameters
[ContentInput, ContentInput, unknown]
required
Returns
MessageSpace
startTyping()
Returns
Promise<void>
stopTyping()
Returns
Promise<void>
unsend()
send(unsend(message)). Accepts Message | undefined so send
results chain without narrowing; an undefined target throws.
Parameters
Returns
Promise<void>