Chat SDK Adds Support for Discord Components V2
Key point
Chat SDK now supports Discord's new layout system, Components V2, enabling more flexible message composition.
Details
With support for Components V2, Chat SDK now offers a flexible layout system that lets you arrange text, images, files, buttons, and more in any order. By setting the adapter's contentFormat option to ComponentsV2, you can render cards using native containers, sections, media galleries, buttons, and more.
The existing Embed method remains the default, ensuring compatibility with existing bots, and each section supports individual actions and markdown rendering. In addition, the adapter automatically manages Discord's platform limitations (such as a maximum of 40 components per message).
This update also includes the following improvements to the Discord adapter:
- Thread renaming: The
setThreadTitle()method allows you to rename Discord thread channels (requires Manage Threads permission). - Ignore global pings: A new
respondToGlobalMentionsoption lets you configure the bot to not treat@everyoneand@herenotifications as mentions. - Precise mention detection: Improved accuracy of mention detection to prevent misfires for users with similar names.