mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-11-21 00:01:32 +00:00
Fix container items having out of date internal state
This commit is contained in:
@@ -30,7 +30,7 @@ import inspect
|
||||
import os
|
||||
|
||||
|
||||
from .item import Item, ContainedItemCallbackType as ItemCallbackType
|
||||
from .item import Item, ContainedItemCallbackType as ItemCallbackType, _ItemCallback
|
||||
from ..enums import ButtonStyle, ComponentType
|
||||
from ..partial_emoji import PartialEmoji, _EmojiTag
|
||||
from ..components import Button as ButtonComponent
|
||||
@@ -304,6 +304,9 @@ class Button(Item[V]):
|
||||
sku_id=self.sku_id,
|
||||
id=self.id,
|
||||
)
|
||||
if isinstance(new.callback, _ItemCallback):
|
||||
new.callback.item = new
|
||||
new._update_view(self.view)
|
||||
return new
|
||||
|
||||
def __deepcopy__(self, memo) -> Self:
|
||||
|
||||
Reference in New Issue
Block a user