diff --git a/interactions/models/discord/components.py b/interactions/models/discord/components.py index 20d4566b6..a656a5295 100644 --- a/interactions/models/discord/components.py +++ b/interactions/models/discord/components.py @@ -209,14 +209,14 @@ class Button(InteractiveComponent): def __init__( self, *, - style: ButtonStyle, + style: ButtonStyle | int, label: str | None = None, emoji: "PartialEmoji | None | str" = None, custom_id: str = None, url: str | None = None, disabled: bool = False, ) -> None: - self.style: ButtonStyle = style + self.style: ButtonStyle = ButtonStyle(style) self.label: str | None = label self.emoji: "PartialEmoji | None" = emoji self.custom_id: str | None = custom_id diff --git a/interactions/models/internal/context.py b/interactions/models/internal/context.py index 1fcf9883c..4e45d8492 100644 --- a/interactions/models/internal/context.py +++ b/interactions/models/internal/context.py @@ -598,7 +598,9 @@ async def defer(self, *, ephemeral: bool = False, edit_origin: bool = False) -> raise RuntimeError("Interaction has already been responded to.") payload = { - "type": CallbackType.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE if not edit_origin else CallbackType.DEFERRED_UPDATE_MESSAGE + "type": CallbackType.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE + if not edit_origin + else CallbackType.DEFERRED_UPDATE_MESSAGE } if ephemeral: if edit_origin: