Skip to content

Commit ce3f355

Browse files
Damegopre-commit-ci[bot]
authored andcommitted
feat: allow passing an integer to button style (#1298)
* feat: allow pass integer to button style * ci: correct from checks. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 38929ad commit ce3f355

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

interactions/models/discord/components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ class Button(InteractiveComponent):
209209
def __init__(
210210
self,
211211
*,
212-
style: ButtonStyle,
212+
style: ButtonStyle | int,
213213
label: str | None = None,
214214
emoji: "PartialEmoji | None | str" = None,
215215
custom_id: str = None,
216216
url: str | None = None,
217217
disabled: bool = False,
218218
) -> None:
219-
self.style: ButtonStyle = style
219+
self.style: ButtonStyle = ButtonStyle(style)
220220
self.label: str | None = label
221221
self.emoji: "PartialEmoji | None" = emoji
222222
self.custom_id: str | None = custom_id

0 commit comments

Comments
 (0)