mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Add item parameter to DynamicItem.from_custom_id
This commit is contained in:
1 parent
7c3868ef3b
commit
f793af0456
4 files changed
+29
-18
No files matched your search
@@ -51,7 +51,7 @@ class DynamicButton(discord.ui.DynamicItem[discord.ui.Button], template=r'button
|
||||
|
||||
# This is called when the button is clicked and the custom_id matches the template.
|
||||
@classmethod
|
||||
async def from_custom_id(cls, interaction: discord.Interaction, match: re.Match[str], /):
|
||||
async def from_custom_id(cls, interaction: discord.Interaction, item: discord.ui.Button, match: re.Match[str], /):
|
||||
user_id = int(match['id'])
|
||||
return cls(user_id)
|
||||
|
||||
|
||||
Reference in new issue
Block a user