mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +00:00
Fix View.from_message not respecting ActionRow row order
This commit is contained in:
parent
9d9d96fce1
commit
efdda635fb
@ -280,8 +280,19 @@ class View:
|
||||
one of its subclasses.
|
||||
"""
|
||||
view = View(timeout=timeout)
|
||||
for component in _walk_all_components(message.components): # type: ignore
|
||||
view.add_item(_component_to_item(component))
|
||||
row = 0
|
||||
for component in message.components:
|
||||
if isinstance(component, ActionRowComponent):
|
||||
for child in component.children:
|
||||
item = _component_to_item(child)
|
||||
item.row = row
|
||||
view.add_item(item)
|
||||
row += 1
|
||||
else:
|
||||
item = _component_to_item(component)
|
||||
item.row = row
|
||||
view.add_item(item)
|
||||
|
||||
return view
|
||||
|
||||
def add_item(self, item: Item[Any]) -> Self:
|
||||
|
Loading…
x
Reference in New Issue
Block a user