@@ -1113,16 +1113,19 @@ async def edit(self, **fields):
1113
1113
pass
1114
1114
else :
1115
1115
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
+
1126
1129
try :
1127
1130
suppress = fields .pop ('suppress' )
1128
1131
except KeyError :
@@ -1648,11 +1651,13 @@ async def edit(self, **fields):
1648
1651
if components is not None :
1649
1652
for component in ([components ] if not type (components ) == list else components ):
1650
1653
if isinstance (component , Button ):
1651
- _components .append ( component . to_dict ())
1654
+ _components .extend ( ActionRow ( component ). sendable ())
1652
1655
elif isinstance (component , DropdownMenue ):
1653
1656
_components .append (component .to_dict ())
1654
1657
elif isinstance (component , ActionRow ):
1655
1658
_components .extend (component .sendable ())
1659
+ elif isinstance (component , list ):
1660
+ _components .extend (ActionRow (* [obj for obj in component if isinstance (obj , Button )]).sendable ())
1656
1661
fields ['components' ] = _components
1657
1662
1658
1663
try :
0 commit comments