@@ -1113,16 +1113,19 @@ async def edit(self, **fields):
11131113 pass
11141114 else :
11151115 if components is not None :
1116- from .components import Button , DropdownMenue , ActionRow
1117- components_list = []
1118- for component in ([components ] if not type (components ) == list else components ):
1119- if isinstance (component , Button ):
1120- components_list .append (component .to_dict ())
1121- elif isinstance (component , DropdownMenue ):
1122- components_list .append (component .to_dict ())
1123- elif isinstance (component , ActionRow ):
1124- components_list .extend (component .sendable ())
1125- fields ['components' ] = components_list
1116+ _components = []
1117+ if components is not None :
1118+ for component in ([components ] if not type (components ) == list else components ):
1119+ if isinstance (component , Button ):
1120+ _components .extend (ActionRow (component ).sendable ())
1121+ elif isinstance (component , DropdownMenue ):
1122+ _components .append (component .to_dict ())
1123+ elif isinstance (component , ActionRow ):
1124+ _components .extend (component .sendable ())
1125+ elif isinstance (component , list ):
1126+ _components .extend (ActionRow (* [obj for obj in component if isinstance (obj , Button )]).sendable ())
1127+ fields ['components' ] = _components
1128+
11261129 try :
11271130 suppress = fields .pop ('suppress' )
11281131 except KeyError :
@@ -1648,11 +1651,13 @@ async def edit(self, **fields):
16481651 if components is not None :
16491652 for component in ([components ] if not type (components ) == list else components ):
16501653 if isinstance (component , Button ):
1651- _components .append ( component . to_dict ())
1654+ _components .extend ( ActionRow ( component ). sendable ())
16521655 elif isinstance (component , DropdownMenue ):
16531656 _components .append (component .to_dict ())
16541657 elif isinstance (component , ActionRow ):
16551658 _components .extend (component .sendable ())
1659+ elif isinstance (component , list ):
1660+ _components .extend (ActionRow (* [obj for obj in component if isinstance (obj , Button )]).sendable ())
16561661 fields ['components' ] = _components
16571662
16581663 try :
0 commit comments