51
51
"MediaGalleryComponentBuilder" ,
52
52
"MediaGalleryItemBuilder" ,
53
53
"SeparatorComponentBuilder" ,
54
- "MessageFileBuilder " ,
55
- "MessageContainerBuilder " ,
56
- "MessageContainerBuilderComponentsT " ,
54
+ "FileComponentBuilder " ,
55
+ "ContainerComponentBuilder " ,
56
+ "ContainerBuilderComponentsT " ,
57
57
"ModalActionRowBuilder" ,
58
58
)
59
59
@@ -2271,11 +2271,11 @@ def type(self) -> typing.Literal[components_.ComponentType.ACTION_ROW]:
2271
2271
2272
2272
@property
2273
2273
@abc .abstractmethod
2274
- def components (self ) -> typing .Sequence [ComponentBuilder ]:
2274
+ def components (self ) -> typing .Sequence [ModalActionRowBuilderComponentsT ]:
2275
2275
"""Sequence of the component builders registered within this action row."""
2276
2276
2277
2277
@abc .abstractmethod
2278
- def add_component (self , component : ComponentBuilder , / ) -> Self :
2278
+ def add_component (self , component : ModalActionRowBuilderComponentsT , / ) -> Self :
2279
2279
"""Add a component to this action row builder.
2280
2280
2281
2281
!!! warning
@@ -2356,9 +2356,10 @@ def type(self) -> typing.Literal[components_.ComponentType.SECTION]:
2356
2356
def components (self ) -> typing .Sequence [TextDisplayComponentBuilder ]:
2357
2357
"""The components attached to the section."""
2358
2358
2359
+ # FIXME: Extract the return type union
2359
2360
@property
2360
2361
@abc .abstractmethod
2361
- def accessory (self ) -> typing .Union [InteractiveButtonBuilder , LinkButtonBuilder , ThumbnailComponentBuilder ]:
2362
+ def accessory (self ) -> typing .Union [ButtonBuilder , ThumbnailComponentBuilder ]:
2362
2363
"""The accessory attached to the section."""
2363
2364
2364
2365
@abc .abstractmethod
@@ -2439,8 +2440,8 @@ def description(self) -> undefined.UndefinedOr[str]:
2439
2440
2440
2441
@property
2441
2442
@abc .abstractmethod
2442
- def spoiler (self ) -> undefined . UndefinedOr [ bool ] :
2443
- """Whether the media has a spoiler."""
2443
+ def is_spoiler (self ) -> bool :
2444
+ """Whether the media is marked as a spoiler."""
2444
2445
2445
2446
2446
2447
class MediaGalleryComponentBuilder (ComponentBuilder , abc .ABC ):
@@ -2484,7 +2485,7 @@ def add_media_gallery_item(
2484
2485
media : files .Resourceish ,
2485
2486
* ,
2486
2487
description : undefined .UndefinedOr [str ] = undefined .UNDEFINED ,
2487
- spoiler : undefined . UndefinedOr [ bool ] = undefined . UNDEFINED ,
2488
+ spoiler : bool = False ,
2488
2489
) -> Self :
2489
2490
"""Add a media gallery item component to this media gallery builder.
2490
2491
@@ -2521,8 +2522,8 @@ def description(self) -> undefined.UndefinedOr[str]:
2521
2522
2522
2523
@property
2523
2524
@abc .abstractmethod
2524
- def spoiler (self ) -> undefined . UndefinedOr [ bool ] :
2525
- """Whether the media has a spoiler."""
2525
+ def is_spoiler (self ) -> bool :
2526
+ """Whether the media is marked as a spoiler."""
2526
2527
2527
2528
@abc .abstractmethod
2528
2529
def build (
@@ -2558,7 +2559,7 @@ def divider(self) -> undefined.UndefinedOr[bool]:
2558
2559
"""Whether the separator has a divider."""
2559
2560
2560
2561
2561
- class MessageFileBuilder (ComponentBuilder , abc .ABC ):
2562
+ class FileComponentBuilder (ComponentBuilder , abc .ABC ):
2562
2563
"""Builder class for file components."""
2563
2564
2564
2565
__slots__ : typing .Sequence [str ] = ()
@@ -2575,11 +2576,11 @@ def file(self) -> files.Resourceish:
2575
2576
2576
2577
@property
2577
2578
@abc .abstractmethod
2578
- def spoiler (self ) -> undefined . UndefinedOr [ bool ] :
2579
+ def is_spoiler (self ) -> bool :
2579
2580
"""Whether the file has a spoiler."""
2580
2581
2581
2582
2582
- class MessageContainerBuilder (ComponentBuilder , abc .ABC ):
2583
+ class ContainerComponentBuilder (ComponentBuilder , abc .ABC ):
2583
2584
"""Builder class for container components."""
2584
2585
2585
2586
__slots__ : typing .Sequence [str ] = ()
@@ -2599,16 +2600,16 @@ def accent_color(self) -> undefined.UndefinedOr[colors.Color]:
2599
2600
2600
2601
@property
2601
2602
@abc .abstractmethod
2602
- def spoiler (self ) -> undefined . UndefinedOr [ bool ] :
2603
+ def is_spoiler (self ) -> bool :
2603
2604
"""Whether the container has a spoiler."""
2604
2605
2605
2606
@property
2606
2607
@abc .abstractmethod
2607
- def components (self ) -> typing .Sequence [MessageContainerBuilderComponentsT ]:
2608
+ def components (self ) -> typing .Sequence [ContainerBuilderComponentsT ]:
2608
2609
"""The components attached to the container."""
2609
2610
2610
2611
@abc .abstractmethod
2611
- def add_component (self , component : MessageContainerBuilderComponentsT ) -> Self :
2612
+ def add_component (self , component : ContainerBuilderComponentsT ) -> Self :
2612
2613
"""Add a component to this container builder.
2613
2614
2614
2615
!!! warning
@@ -2627,7 +2628,7 @@ def add_component(self, component: MessageContainerBuilderComponentsT) -> Self:
2627
2628
2628
2629
Returns
2629
2630
-------
2630
- MessageContainerBuilder
2631
+ ContainerComponentBuilder
2631
2632
The builder object to enable chained calls.
2632
2633
"""
2633
2634
@@ -2651,7 +2652,7 @@ def add_action_row(
2651
2652
2652
2653
Returns
2653
2654
-------
2654
- MessageContainerBuilder
2655
+ ContainerComponentBuilder
2655
2656
The builder object to enable chained calls.
2656
2657
"""
2657
2658
@@ -2670,7 +2671,7 @@ def add_text_display(self, content: str, *, id: undefined.UndefinedOr[int] = und
2670
2671
2671
2672
Returns
2672
2673
-------
2673
- MessageContainerBuilder
2674
+ ContainerComponentBuilder
2674
2675
The builder object to enable chained calls.
2675
2676
"""
2676
2677
@@ -2691,16 +2692,16 @@ def add_media_gallery(
2691
2692
2692
2693
Returns
2693
2694
-------
2694
- MessageContainerBuilder
2695
+ ContainerComponentBuilder
2695
2696
The builder object to enable chained calls.
2696
2697
"""
2697
2698
2698
2699
@abc .abstractmethod
2699
2700
def add_separator (
2700
2701
self ,
2701
2702
* ,
2702
- spacing : undefined . UndefinedOr [ components_ .SpacingType ] = undefined . UNDEFINED ,
2703
- divider : undefined . UndefinedOr [ bool ] = undefined . UNDEFINED ,
2703
+ spacing : components_ .SpacingType = components_ . SpacingType . SMALL ,
2704
+ divider : bool = False ,
2704
2705
id : undefined .UndefinedOr [int ] = undefined .UNDEFINED ,
2705
2706
) -> Self :
2706
2707
"""Add a separator component to this container builder.
@@ -2718,17 +2719,13 @@ def add_separator(
2718
2719
2719
2720
Returns
2720
2721
-------
2721
- MessageContainerBuilder
2722
+ ContainerComponentBuilder
2722
2723
The builder object to enable chained calls.
2723
2724
"""
2724
2725
2725
2726
@abc .abstractmethod
2726
2727
def add_file (
2727
- self ,
2728
- file : files .Resourceish ,
2729
- * ,
2730
- spoiler : undefined .UndefinedOr [bool ] = undefined .UNDEFINED ,
2731
- id : undefined .UndefinedOr [int ] = undefined .UNDEFINED ,
2728
+ self , file : files .Resourceish , * , spoiler : bool = False , id : undefined .UndefinedOr [int ] = undefined .UNDEFINED
2732
2729
) -> Self :
2733
2730
"""Add a spoiler component to this container builder.
2734
2731
@@ -2745,23 +2742,25 @@ def add_file(
2745
2742
2746
2743
Returns
2747
2744
-------
2748
- MessageContainerBuilder
2745
+ ContainerComponentBuilder
2749
2746
The builder object to enable chained calls.
2750
2747
"""
2751
2748
2752
2749
2753
- MessageContainerBuilderComponentsT = typing .Union [ # FIXME: I got no idea where this should be put.
2750
+ ContainerBuilderComponentsT = typing .Union [
2754
2751
MessageActionRowBuilder ,
2755
2752
TextDisplayComponentBuilder ,
2756
2753
SectionComponentBuilder ,
2757
2754
MediaGalleryComponentBuilder ,
2758
2755
SeparatorComponentBuilder ,
2759
- MessageFileBuilder ,
2756
+ FileComponentBuilder ,
2760
2757
]
2761
2758
"""FIXME: Document me."""
2762
2759
2763
2760
2764
- MessageActionRowBuilderComponentsT = typing .Union [ # FIXME: I got no idea where this should be put.
2765
- ButtonBuilder , SelectMenuBuilder
2766
- ]
2761
+ MessageActionRowBuilderComponentsT = typing .Union [ButtonBuilder , SelectMenuBuilder ]
2767
2762
"""FIXME: Document me."""
2763
+
2764
+ ModalActionRowBuilderComponentsT = TextInputBuilder
2765
+ """"FIXME: Document me."""
2766
+ # FIXME: Add ModalActionRowBuilderComponentsT
0 commit comments