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

Resolve issues with discord.Thread and discord.ThreadOption when used in discord.Option #1427

Merged
merged 9 commits into from
Jun 24, 2022

Conversation

baronkobama
Copy link
Contributor

@baronkobama baronkobama commented Jun 16, 2022

Summary

This PR resolves issues when using discord.Thread as a discord.Option input type. Previously, doing so raised an error: TypeError: 'NoneType' object is not callable. Now, threads are correctly handled when given as an option type. A few touchups to changes made in #1365 are also made here including comment updates and updates to how the _invoke_flag key works when being added to data. Atop of this, discord.ThreadOption now has documentation with this PR.

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, ...)

Lulalaby
Lulalaby previously approved these changes Jun 16, 2022
@Lulalaby Lulalaby enabled auto-merge (squash) June 16, 2022 08:12
@Lulalaby Lulalaby requested a review from Dorukyum June 16, 2022 08:12
@baronkobama
Copy link
Contributor Author

This PR may not be necessary since ThreadOption exists, however, there does appear to be an issue with ThreadOption and I may convert this PR into resolving that since it is closely related.

@baronkobama
Copy link
Contributor Author

I've decided to patch the issue with ThreadOption but keep the changes in this PR as they will allow for discord.Thread to be used directly as an input type now, avoiding confusion. This does make ThreadOption effectively useless, but removing it would be considered a breaking change and I think we're too close to 2.0.0 full release to have breaking changes now.

discord/commands/options.py Outdated Show resolved Hide resolved
discord/commands/options.py Outdated Show resolved Hide resolved
discord/commands/core.py Outdated Show resolved Hide resolved
discord/threads.py Outdated Show resolved Hide resolved
@baronkobama baronkobama changed the title Fix discord.Thread not working as discord.Option input type Resolve issues with discord.Thread and discord.ThreadOption when used in discord.Option Jun 17, 2022
Dorukyum
Dorukyum previously approved these changes Jun 22, 2022
@Dorukyum Dorukyum enabled auto-merge (squash) June 22, 2022 14:05
@Dorukyum Dorukyum merged commit d40793e into Pycord-Development:master Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants