Backs the capability-gated `Thread.setTitle` for pane threads.
(
target: BotReplyTarget,
title: string,
)
| 644 | |
| 645 | /** Backs the capability-gated `Thread.setTitle` for pane threads. */ |
| 646 | async setThreadTitle( |
| 647 | target: BotReplyTarget, |
| 648 | title: string, |
| 649 | ): Promise<{ ok: boolean; error?: string }> { |
| 650 | const t = target as ReplyTarget; |
| 651 | if (!this.isPaneTarget(t)) { |
| 652 | return { |
| 653 | ok: false, |
| 654 | error: "thread title requires an assistant-pane thread", |
| 655 | }; |
| 656 | } |
| 657 | try { |
| 658 | await this.client.assistant.threads.setTitle({ |
| 659 | channel_id: t.channel, |
| 660 | thread_ts: t.threadTs, |
| 661 | title, |
| 662 | }); |
| 663 | return { ok: true }; |
| 664 | } catch (e) { |
| 665 | return { ok: false, error: (e as Error).message }; |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | decodeInteraction(raw: unknown): InteractionEvent | undefined { |
| 670 | return decodeInteraction(raw); |
nothing calls this directly
no test coverage detected