Vercel Chat SDK、Discord コンポーネント V2 をサポート
Chat SDK は Discord Components V2 のサポートを追加し、より柔軟なレイアウト構築やスレッド管理機能の強化など、ボット開発者の実用性を高める更新を行いました。
キーポイント
Components V2 の正式対応
テキスト、画像、ボタンなどを自由な順序で配置できる新しいレイアウトシステム「Components V2」をサポートし、既存のボットはデフォルト動作を維持します。
スレッド管理機能の追加
ネイティブ Discord スレッドチャンネルの名前変更機能を `setThreadTitle()` メソッドとして実装し、適切な権限を持つボットが利用可能になりました。
メンション検出精度と通知制御の向上
類似名による誤った一致を防ぐ高精度なメンション検出機能と、ゲートウェイモードでのグローバル通知(@everyone/@here)を無効化する設定オプションが追加されました。
重要な引用
an opt-in layout system that treats text, images, files, and buttons as flexible components you can arrange in any order
A new setThreadTitle() method renames native Discord thread channels.
Mentions of similarly named users no longer trigger false matches.
影響分析・編集コメントを表示
影響分析
この更新により、Discord ボット開発者はより現代的で複雑な UI を構築できるようになり、ユーザー体験の向上に寄与します。また、メンション検出の精度向上や通知制御機能は、大規模なコミュニティ運営におけるボットの安定性と信頼性を高める重要な要素です。
編集コメント
Discord のプラットフォーム進化に伴い、開発者ツールが迅速に追従している様子が伺えます。特にメンション検出の精度向上は、実運用におけるバグ防止として極めて価値が高いと言えます。
Discord のボットメッセージに、Components V2 のサポートが追加されました。これはテキスト、画像、ファイル、ボタンを柔軟なコンポーネントとして扱い、好きな順序で配置できるオプトイン型のレイアウトシステムです。
アダプターの contentFormat オプションを ComponentsV2 に設定すると、カードはネイティブのコンテナ、セクション、メディアギャラリー、区切り線、ボタン、文字列選択ボックスを使ってレンダリングされます。デフォルトは依然として埋め込み(Embeds)のままなので、既存のボットも変更なしで動作します。
個々のセクションには独自のアクションを設定でき、コンポーネント内でのマークダウン表示も正しく機能します。また、アダプターが自動的に Discord のプラットフォーム制限を適用し、1 つのメッセージに含まれるコンポーネント数の上限(40 個)を守ります。
今回のリリースでは、Discord アダプターの他の改善点もいくつか追加されています:
- スレッド名の書き換え: 新しい
setThreadTitle()メソッドにより、ネイティブの Discord スレッドチャンネルの名前を変更できるようになりました。これを利用するには、ボットに「スレッドの管理」権限が必要です。 - グローバルメンションの無視: ゲートウェイモードで動作するボットは、
@everyoneや@hereによる通知をメンションとして扱わなくなりました。ただし、新しい設定オプションrespondToGlobalMentions(デフォルトは false)を有効にすることで、再びメンションを受け取るように切り替えることも可能です。個別のメンション、ロールへの言及、ボットへの返信には影響ありません。 - 正確なメンション検出: 名前が類似したユーザーとの誤った一致を防ぎます。例えば、
@bot-devと入力しても、もはやボットのタグとして認識されません。
詳細はドキュメントをご覧ください。またはアダプターディレクトリから探すこともできます。
これらの改善に貢献してくれたコミュニティのメンバー、DeanMauro さん、onmax さん、FarazPatankar さん、そして sivchari さんに特別なお礼を申し上げます。
原文を表示
You can now send Discord bot messages with Components V2, an opt-in layout system that treats text, images, files, and buttons as flexible components you can arrange in any order.
Set the adapter's contentFormat option to ComponentsV2 and cards render with native containers, sections, media galleries, separators, buttons, and string selects. Embeds remain the default, so existing bots work unchanged.
Individual sections can carry their own actions, markdown renders correctly inside components, and the adapter enforces Discord's platform limits for you, including the 40-component cap per message.
This release also includes several other Discord adapter improvements:
Rename threads: A new setThreadTitle()method renames native Discord thread channels. Your bot needs the Manage Threads permission to use it.
Ignore global pings: Bots running in gateway mode no longer treat @everyone and @here announcements as mentions. A new respondToGlobalMentions config option (default false) lets you opt back in. Direct mentions, role mentions, and replies to the bot are unaffected.
Precise mention detection: Mentions of similarly named users no longer trigger false matches. A message with @bot-dev no longer counts as a bot tag.
Read the documentation to get started or browse the adapter directory.
Special thanks to community contributors DeanMauro, onmax, FarazPatankar, and sivchari for laying the groundwork for these improvements.
Read more
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み