Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Modal.children to be a property, allow instantiating with list of InputText components #1311

Merged
merged 4 commits into from
May 8, 2022
Merged

Conversation

krittick
Copy link
Contributor

@krittick krittick commented May 1, 2022

Summary

This changes Modal.children to be a property instead of an attribute. This also adds a children parameter to Modal.__init__ to allow instantiating the Modal with list of InputText objects instead of requiring developers to use Modal.add_item

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, typehinting, examples, ...)

Also allow instantiating a modal with a list of InputText items instead of needing to use modal.add_item
@krittick krittick added priority: medium Medium Priority status: awaiting review Awaiting review from a maintainer feature Implements a feature Merge with squash labels May 1, 2022
@krittick krittick added this to the v2.0 milestone May 1, 2022
@krittick krittick self-assigned this May 1, 2022
@krittick krittick enabled auto-merge (squash) May 1, 2022 00:43
@Dorukyum
Copy link
Member

Dorukyum commented May 1, 2022

The children parameter could be turned into a variadic argument (*children: InputText) to reflect the items parameter of View

@krittick
Copy link
Contributor Author

krittick commented May 7, 2022

The children parameter could be turned into a variadic argument (*children: InputText) to reflect the items parameter of View

This is a good idea, and I've made the requested change. I believe that makes this PR a breaking change now, but shouldn't matter much since 2.0 is still in beta.

@Pycord-Development Pycord-Development deleted a comment from codecov bot May 8, 2022
@krittick krittick merged commit 2e51b4d into Pycord-Development:master May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Implements a feature priority: medium Medium Priority status: awaiting review Awaiting review from a maintainer
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants