feat: Radio Groups & Checkboxes#3073
Open
NeloBlivion wants to merge 42 commits intoPycord-Development:masterfrom
Open
feat: Radio Groups & Checkboxes#3073NeloBlivion wants to merge 42 commits intoPycord-Development:masterfrom
NeloBlivion wants to merge 42 commits intoPycord-Development:masterfrom
Conversation
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/3073/head:pr-3073
git checkout pr-3073This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3073/head |
Signed-off-by: Lala Sabathil <[email protected]>
Lulalaby
reviewed
Jan 21, 2026
Signed-off-by: Lala Sabathil <[email protected]>
Lulalaby
reviewed
Jan 21, 2026
Signed-off-by: Lala Sabathil <[email protected]>
JustaSqu1d
requested changes
Jan 21, 2026
Paillat-dev
reviewed
Jan 21, 2026
Signed-off-by: Nelo <[email protected]>
Co-authored-by: Paillat <[email protected]> Signed-off-by: Nelo <[email protected]>
Co-authored-by: JustaSqu1d <[email protected]> Signed-off-by: Nelo <[email protected]>
Co-authored-by: JustaSqu1d <[email protected]> Signed-off-by: Nelo <[email protected]>
Co-authored-by: JustaSqu1d <[email protected]> Signed-off-by: Nelo <[email protected]>
Member
Author
|
todo:
|
Member
Test Codeimport logging
import os
from typing import override
from dotenv import load_dotenv
import discord
load_dotenv()
logging.basicConfig(level=logging.INFO)
bot = discord.Bot(intents=discord.Intents.all())
class WowModal(discord.ui.DesignerModal):
def __init__(self):
super().__init__(timeout=None, title="PYCORD IS AMAZING")
self.add_item(
discord.ui.Label(
label="Enable",
description="Enable or disable the bot",
item=discord.ui.Checkbox(default=False),
)
)
@override
async def callback(self, interaction: discord.Interaction):
await interaction.respond("Button clicked!")
@bot.slash_command(name="test_modalsv5")
async def test_modal(ctx: discord.ApplicationContext):
await ctx.send_modal(WowModal())
bot.run(os.getenv("TOKEN_2"))Fyi I encounter this: |
Member
Author
|
probably done? |
Soheab
requested changes
Feb 11, 2026
Comment on lines
+1781
to
+1782
| if self.default is not None: | ||
| payload["default"] = self.default |
Contributor
There was a problem hiding this comment.
Can't be None, should be in the initial payload.
Comment on lines
+85
to
+89
| def __repr__(self) -> str: | ||
| attrs = " ".join( | ||
| f"{key}={getattr(self, key)!r}" for key in self.__item_repr_attributes__ | ||
| ) | ||
| return f"<{self.__class__.__name__} {attrs}>" |
Contributor
There was a problem hiding this comment.
Why does it redefine this? It's handled by Item.
| custom_id: Optional[:class:`str`] | ||
| The custom ID of the radio group that gets received during an interaction. | ||
| options: List[:class:`RadioGroupOption`] | ||
| A list of options that can be selected in this group. |
Contributor
There was a problem hiding this comment.
Could mention that this can only contain min 2 and max 10 items.
Comment on lines
+112
to
+116
| def __repr__(self) -> str: | ||
| attrs = " ".join( | ||
| f"{key}={getattr(self, key)!r}" for key in self.__item_repr_attributes__ | ||
| ) | ||
| return f"<{self.__class__.__name__} {attrs}>" |
Comment on lines
+94
to
+98
| def __repr__(self) -> str: | ||
| attrs = " ".join( | ||
| f"{key}={getattr(self, key)!r}" for key in self.__item_repr_attributes__ | ||
| ) | ||
| return f"<{self.__class__.__name__} {attrs}>" |
Comment on lines
+156
to
+157
| if len(value) > 10: | ||
| raise ValueError("you may only provide up to 10 options.") |
Contributor
There was a problem hiding this comment.
Maybe also check the minimum (2)?
Contributor
|
All version strings need changing to 2.8 too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements radio groups, checkbox groups, and checkboxes in modals

Alpha server only right now
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.