INNER CODE UNIT · TypeScript

postNotice

Beever-AI/beever-atlas · bot/src/index.ts:247

export async function postNotice(thread: PostableThread, author: unknown, text: string): Promise<void> {
  if (author != null && typeof thread.postEphemeral === "function") {
    try {
      await thread.postEphemeral(author, text, { fallbackToDM: true });
      return;
    } catch (err) {
      console.error("Ephemeral notice failed; falling back to post:", safeErrorMessage(err));
    }
  }
  await thread.post(text);
}

/**
 * Inbound rate gate, keyed per (platform, channel, user) so one user can't
 * exhaust a shared channel's budget. On the first block within a window it posts
 * a single friendly notice (the notice itself is rate-limited), then drops
 * silently. Returns true when the request may proceed.
 */

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…