mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 17:36:15 +00:00
Add support for sending views in stateless webhooks
This commit is contained in:
@ -214,6 +214,11 @@ class View:
|
||||
# Wait N seconds to see if timeout data has been refreshed
|
||||
await asyncio.sleep(self.__timeout_expiry - now)
|
||||
|
||||
def is_dispatchable(self) -> bool:
|
||||
# this is used by webhooks to check whether a view requires a state attached
|
||||
# or not, this simply is, whether a view has a component other than a url button
|
||||
return any(item.is_dispatchable() for item in self.children)
|
||||
|
||||
def to_components(self) -> List[Dict[str, Any]]:
|
||||
def key(item: Item) -> int:
|
||||
return item._rendered_row or 0
|
||||
|
Reference in New Issue
Block a user