File tree Expand file tree Collapse file tree
src/Disc.NET.Client.SDK/Messages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,16 +28,17 @@ public class ApiMessage
2828
2929 public List < object > MountComponents ( )
3030 {
31- var results = new List < object > ( ) ;
31+ if ( Components . Count > 5 )
32+ throw new DiscNetGenericException ( "The message cannot contain more than 5 top-level components." ) ;
33+
34+ var results = new List < object > ( ) ;
35+
3236 NormalizeActionRows < ActionRowSelectMenuComponentBuilder > ( ActionRowConstraint . MAX_SELECT_MENUS_PER_ACTION_ROW , message =>
3337 new ActionRowSelectMenuComponentBuilder ( ) . AddMenu ( message . First ( ) ) ) ;
3438
3539 NormalizeActionRows < ActionRowButtonComponentBuilder > ( ActionRowConstraint . MAX_BUTTONS_PER_ACTION_ROW , message =>
3640 new ActionRowButtonComponentBuilder ( ) . AddButtons ( message ) ) ;
3741
38- if ( Components . Count > 5 )
39- throw new DiscNetGenericException ( "The message cannot contain more than 5 top-level components." ) ;
40-
4142 Components . ForEach ( x => results . Add ( x . Build ( ) ) ) ;
4243 return results ;
4344 }
You can’t perform that action at this time.
0 commit comments