MCPcopy Create free account
hub / github.com/CopilotKit/CopilotKit / postEphemeral

Method postEphemeral

packages/bot/src/thread.ts:211–227  ·  view source on GitHub ↗

* Post a message only `user` can see. `fallbackToDM` is required: * `true` → DM the user when native ephemeral is unsupported; `false` → * resolve to `null` when native ephemeral is unsupported.

(
    user: PlatformUser | string,
    ui: Renderable,
    opts: { fallbackToDM: boolean },
  )

Source from the content-addressed store, hash-verified

209 * resolve to `null` when native ephemeral is unsupported.
210 */
211 async postEphemeral(
212 user: PlatformUser | string,
213 ui: Renderable,
214 opts: { fallbackToDM: boolean },
215 ): Promise<EphemeralResult | null> {
216 const adapter = this.deps.adapter;
217 if (!adapter.postEphemeral) {
218 return {
219 ok: false,
220 error: `${this.platform} does not support ephemeral messages`,
221 };
222 }
223 // Ephemeral messages can't be reacted to, so any `onReaction` is dropped
224 // (stripped by bindForPost) rather than registered.
225 const { root } = await this.bindForPost(ui);
226 return adapter.postEphemeral(this.deps.replyTarget, user, root, opts);
227 }
228
229 // Subscription STORAGE lands here; subscription ROUTING (onSubscribedMessage) is deferred.
230

Callers

nothing calls this directly

Calls 2

bindForPostMethod · 0.95
postEphemeralMethod · 0.65

Tested by

no test coverage detected