@@ -114,8 +114,15 @@ pub struct Section {
114114 /// Always [`ComponentType::Section`]
115115 #[ serde( rename = "type" ) ]
116116 pub kind : ComponentType ,
117- components : FixedArray < SectionComponent > ,
118- accessory : SectionAccessory ,
117+ /// The components inside of the section.
118+ ///
119+ /// As of 2025-02-28, this is limited to just [`ComponentType::TextDisplay`] with up to 3 max.
120+ pub components : FixedArray < Component > ,
121+ /// The accessory to the side of the section.
122+ ///
123+ /// As of 2025-02-28, this is limited to [`ComponentType::Button`] or
124+ /// [`ComponentType::Thumbnail`]
125+ pub accessory : Box < Component > ,
119126}
120127
121128/// A section component's thumbnail.
@@ -130,8 +137,11 @@ pub struct Thumbnail {
130137 /// Always [`ComponentType::Thumbnail`]
131138 #[ serde( rename = "type" ) ]
132139 pub kind : ComponentType ,
133- media : UnfurledMediaItem ,
140+ /// The internal media item this contains.
141+ pub media : UnfurledMediaItem ,
142+ /// The description of the thumbnail.
134143 description : Option < FixedString < u16 > > ,
144+ /// Whether or not this component is spoilered.
135145 spoiler : Option < bool > ,
136146}
137147
@@ -152,7 +162,8 @@ pub enum MediaItem {
152162#[ derive( Clone , Debug , Deserialize , Serialize ) ]
153163#[ non_exhaustive]
154164pub struct UnfurledMediaItem {
155- url : FixedString < u16 > ,
165+ /// The url of this item.
166+ pub url : FixedString < u16 > ,
156167}
157168
158169/// A resolved unfurled media item, with extra metadata added by Discord.
@@ -162,12 +173,18 @@ pub struct UnfurledMediaItem {
162173#[ derive( Clone , Debug , Deserialize , Serialize ) ]
163174#[ non_exhaustive]
164175pub struct ResolvedUnfurledMediaItem {
165- url : FixedString < u16 > ,
166- proxy_url : FixedString < u16 > ,
167- width : NonMaxU32 ,
168- height : NonMaxU32 ,
169- content_type : FixedString ,
170- loading_state : UnfurledMediaItemLoadingState ,
176+ /// The url of this item.
177+ pub url : FixedString < u16 > ,
178+ /// The proxied discord url.
179+ pub proxy_url : FixedString < u16 > ,
180+ /// The width of the media item.
181+ pub width : NonMaxU32 ,
182+ /// The height of the media item.
183+ pub height : NonMaxU32 ,
184+ /// The content type of the media item.
185+ pub content_type : FixedString ,
186+ /// The loading state of the item, declaring if it has fully loaded yet.
187+ pub loading_state : UnfurledMediaItemLoadingState ,
171188}
172189
173190enum_number ! {
@@ -213,7 +230,8 @@ pub enum SectionComponent {
213230#[ derive( Clone , Debug , Deserialize , Serialize ) ]
214231#[ non_exhaustive]
215232pub struct TextDisplay {
216- content : FixedString < u16 > ,
233+ /// The content of this text display component.
234+ pub content : FixedString < u16 > ,
217235}
218236
219237/// A media gallery component.
@@ -226,7 +244,8 @@ pub struct MediaGallery {
226244 /// Always [`ComponentType::MediaGallery`]
227245 #[ serde( rename = "type" ) ]
228246 pub kind : ComponentType ,
229- items : FixedArray < MediaGalleryItem > ,
247+ /// Array of images this media gallery can contain, max of 10.
248+ pub items : FixedArray < MediaGalleryItem > ,
230249}
231250
232251/// An individual media gallery item.
@@ -238,9 +257,12 @@ pub struct MediaGallery {
238257#[ derive( Clone , Debug , Deserialize , Serialize ) ]
239258#[ non_exhaustive]
240259pub struct MediaGalleryItem {
241- media : UnfurledMediaItem ,
242- description : Option < FixedString < u16 > > ,
243- spoiler : Option < bool > ,
260+ /// The internal media piece that this item contains.
261+ pub media : UnfurledMediaItem ,
262+ /// The description of the media item.
263+ pub description : Option < FixedString < u16 > > ,
264+ /// Whether or not this component is spoilered.
265+ pub spoiler : Option < bool > ,
244266}
245267
246268/// A separator component
@@ -253,8 +275,10 @@ pub struct Separator {
253275 /// Always [`ComponentType::Separator`]
254276 #[ serde( rename = "type" ) ]
255277 pub kind : ComponentType ,
256- divider : Option < bool > ,
257- spacing : Option < SeparatorSpacingSize > ,
278+ /// Whether or not this contains a separating divider.
279+ pub divider : Option < bool > ,
280+ /// The spacing of the separator.
281+ pub spacing : Option < SeparatorSpacingSize > ,
258282}
259283
260284enum_number ! {
@@ -279,8 +303,10 @@ pub struct FileComponent {
279303 /// Always [`ComponentType::File`]
280304 #[ serde( rename = "type" ) ]
281305 pub kind : ComponentType ,
282- file : UnfurledMediaItem ,
283- spoiler : Option < bool > ,
306+ /// The file this component internally contains.
307+ pub file : UnfurledMediaItem ,
308+ /// Whether or not this component is spoilered.
309+ pub spoiler : Option < bool > ,
284310}
285311
286312/// A container component, similar to an embed but without all the functionality.
@@ -293,9 +319,16 @@ pub struct Container {
293319 /// Always [`ComponentType::Container`]
294320 #[ serde( rename = "type" ) ]
295321 pub kind : ComponentType ,
296- accent_color : Option < Colour > ,
297- spoiler : Option < bool > ,
298- components : FixedArray < Component > ,
322+ /// The accent colour, similar to an embeds accent.
323+ pub accent_color : Option < Colour > ,
324+ /// Whether or not this component is spoilered.
325+ pub spoiler : Option < bool > ,
326+ /// The components within this container.
327+ ///
328+ /// As of 2025-02-28, this can be [`ComponentType::ActionRow`], [`ComponentType::Section`],
329+ /// [`ComponentType::TextDisplay`], [`ComponentType::MediaGallery`], [`ComponentType::File`] or
330+ /// [`ComponentType::Separator`]
331+ pub components : FixedArray < Component > ,
299332}
300333
301334/// An action row.
0 commit comments