@@ -291,6 +291,7 @@ def add_button(
291
291
url : Optional [str ] = None ,
292
292
emoji : Optional [Union [str , Emoji , PartialEmoji ]] = None ,
293
293
sku_id : Optional [int ] = None ,
294
+ id : int = 0 ,
294
295
) -> ButtonCompatibleActionRowT :
295
296
"""Add a button to the action row. Can only be used if the action
296
297
row holds message components.
@@ -326,6 +327,12 @@ def add_button(
326
327
The ID of a purchasable SKU, for premium buttons.
327
328
Premium buttons additionally cannot have a ``label``, ``url``, or ``emoji``.
328
329
330
+ .. versionadded:: 2.11
331
+ id: :class:`int`
332
+ The numeric identifier for the component.
333
+ If left unset (i.e. the default ``0``) when sending a component, the API will assign
334
+ sequential identifiers to the components in the message.
335
+
329
336
.. versionadded:: 2.11
330
337
331
338
Raises
@@ -336,6 +343,7 @@ def add_button(
336
343
self .insert_item (
337
344
len (self ) if index is None else index ,
338
345
Button (
346
+ id = id ,
339
347
style = style ,
340
348
label = label ,
341
349
disabled = disabled ,
@@ -356,6 +364,7 @@ def add_string_select(
356
364
max_values : int = 1 ,
357
365
options : SelectOptionInput = MISSING ,
358
366
disabled : bool = False ,
367
+ id : int = 0 ,
359
368
) -> SelectCompatibleActionRowT :
360
369
"""Add a string select menu to the action row. Can only be used if the action
361
370
row holds message components.
@@ -387,6 +396,12 @@ def add_string_select(
387
396
as a list of labels, and a dict will be treated as a mapping of labels to values.
388
397
disabled: :class:`bool`
389
398
Whether the select is disabled or not.
399
+ id: :class:`int`
400
+ The numeric identifier for the component.
401
+ If left unset (i.e. the default ``0``) when sending a component, the API will assign
402
+ sequential identifiers to the components in the message.
403
+
404
+ .. versionadded:: 2.11
390
405
391
406
Raises
392
407
------
@@ -395,6 +410,7 @@ def add_string_select(
395
410
"""
396
411
self .append_item (
397
412
StringSelect (
413
+ id = id ,
398
414
custom_id = custom_id ,
399
415
placeholder = placeholder ,
400
416
min_values = min_values ,
@@ -416,6 +432,7 @@ def add_user_select(
416
432
max_values : int = 1 ,
417
433
disabled : bool = False ,
418
434
default_values : Optional [Sequence [SelectDefaultValueInputType [Union [User , Member ]]]] = None ,
435
+ id : int = 0 ,
419
436
) -> SelectCompatibleActionRowT :
420
437
"""Add a user select menu to the action row. Can only be used if the action
421
438
row holds message components.
@@ -447,6 +464,12 @@ def add_user_select(
447
464
If set, the number of items must be within the bounds set by ``min_values`` and ``max_values``.
448
465
449
466
.. versionadded:: 2.10
467
+ id: :class:`int`
468
+ The numeric identifier for the component.
469
+ If left unset (i.e. the default ``0``) when sending a component, the API will assign
470
+ sequential identifiers to the components in the message.
471
+
472
+ .. versionadded:: 2.11
450
473
451
474
Raises
452
475
------
@@ -455,6 +478,7 @@ def add_user_select(
455
478
"""
456
479
self .append_item (
457
480
UserSelect (
481
+ id = id ,
458
482
custom_id = custom_id ,
459
483
placeholder = placeholder ,
460
484
min_values = min_values ,
@@ -474,6 +498,7 @@ def add_role_select(
474
498
max_values : int = 1 ,
475
499
disabled : bool = False ,
476
500
default_values : Optional [Sequence [SelectDefaultValueInputType [Role ]]] = None ,
501
+ id : int = 0 ,
477
502
) -> SelectCompatibleActionRowT :
478
503
"""Add a role select menu to the action row. Can only be used if the action
479
504
row holds message components.
@@ -505,6 +530,12 @@ def add_role_select(
505
530
If set, the number of items must be within the bounds set by ``min_values`` and ``max_values``.
506
531
507
532
.. versionadded:: 2.10
533
+ id: :class:`int`
534
+ The numeric identifier for the component.
535
+ If left unset (i.e. the default ``0``) when sending a component, the API will assign
536
+ sequential identifiers to the components in the message.
537
+
538
+ .. versionadded:: 2.11
508
539
509
540
Raises
510
541
------
@@ -513,6 +544,7 @@ def add_role_select(
513
544
"""
514
545
self .append_item (
515
546
RoleSelect (
547
+ id = id ,
516
548
custom_id = custom_id ,
517
549
placeholder = placeholder ,
518
550
min_values = min_values ,
@@ -534,6 +566,7 @@ def add_mentionable_select(
534
566
default_values : Optional [
535
567
Sequence [SelectDefaultValueMultiInputType [Union [User , Member , Role ]]]
536
568
] = None ,
569
+ id : int = 0 ,
537
570
) -> SelectCompatibleActionRowT :
538
571
"""Add a mentionable (user/member/role) select menu to the action row. Can only be used if the action
539
572
row holds message components.
@@ -567,6 +600,12 @@ def add_mentionable_select(
567
600
Note that unlike other select menu types, this does not support :class:`.Object`\\ s due to ambiguities.
568
601
569
602
.. versionadded:: 2.10
603
+ id: :class:`int`
604
+ The numeric identifier for the component.
605
+ If left unset (i.e. the default ``0``) when sending a component, the API will assign
606
+ sequential identifiers to the components in the message.
607
+
608
+ .. versionadded:: 2.11
570
609
571
610
Raises
572
611
------
@@ -575,6 +614,7 @@ def add_mentionable_select(
575
614
"""
576
615
self .append_item (
577
616
MentionableSelect (
617
+ id = id ,
578
618
custom_id = custom_id ,
579
619
placeholder = placeholder ,
580
620
min_values = min_values ,
@@ -595,6 +635,7 @@ def add_channel_select(
595
635
disabled : bool = False ,
596
636
channel_types : Optional [List [ChannelType ]] = None ,
597
637
default_values : Optional [Sequence [SelectDefaultValueInputType [AnyChannel ]]] = None ,
638
+ id : int = 0 ,
598
639
) -> SelectCompatibleActionRowT :
599
640
"""Add a channel select menu to the action row. Can only be used if the action
600
641
row holds message components.
@@ -629,6 +670,12 @@ def add_channel_select(
629
670
If set, the number of items must be within the bounds set by ``min_values`` and ``max_values``.
630
671
631
672
.. versionadded:: 2.10
673
+ id: :class:`int`
674
+ The numeric identifier for the component.
675
+ If left unset (i.e. the default ``0``) when sending a component, the API will assign
676
+ sequential identifiers to the components in the message.
677
+
678
+ .. versionadded:: 2.11
632
679
633
680
Raises
634
681
------
@@ -637,6 +684,7 @@ def add_channel_select(
637
684
"""
638
685
self .append_item (
639
686
ChannelSelect (
687
+ id = id ,
640
688
custom_id = custom_id ,
641
689
placeholder = placeholder ,
642
690
min_values = min_values ,
@@ -659,6 +707,7 @@ def add_text_input(
659
707
required : bool = True ,
660
708
min_length : Optional [int ] = None ,
661
709
max_length : Optional [int ] = None ,
710
+ id : int = 0 ,
662
711
) -> TextInputCompatibleActionRowT :
663
712
"""Add a text input to the action row. Can only be used if the action
664
713
row holds modal components.
@@ -688,6 +737,12 @@ def add_text_input(
688
737
The minimum length of the text input.
689
738
max_length: Optional[:class:`int`]
690
739
The maximum length of the text input.
740
+ id: :class:`int`
741
+ The numeric identifier for the component.
742
+ If left unset (i.e. the default ``0``) when sending a component, the API will assign
743
+ sequential identifiers to the components in the message.
744
+
745
+ .. versionadded:: 2.11
691
746
692
747
Raises
693
748
------
@@ -696,6 +751,7 @@ def add_text_input(
696
751
"""
697
752
self .append_item (
698
753
TextInput (
754
+ id = id ,
699
755
label = label ,
700
756
custom_id = custom_id ,
701
757
style = style ,
0 commit comments