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

fix: Document Option.channel_types and properly support further channel types #1883

Merged
merged 11 commits into from Jan 27, 2023

Conversation

NeloBlivion
Copy link
Member

@NeloBlivion NeloBlivion commented Jan 17, 2023

Summary

  • Finally documents discord.Option.channel_types
  • Allows input_type to accept discord.ForumChannel and discord.DMChannel.
    Ref. discord.ForumChannel Bug #1882
  • channel_types now overrides the input_type

Information

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

Checklist

  • I have searched the open pull requests for duplicates.
  • 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.

@NeloBlivion NeloBlivion changed the title fix: Document Option.channel_types and properly support discord.ForumChannel input_type fix: Document Option.channel_types and properly support further channel types Jan 18, 2023
@NeloBlivion
Copy link
Member Author

NeloBlivion commented Jan 18, 2023

So some clarification

  1. channel_types only worked if you use discord.SlashCommandOptionType.channel, not standard channel classes (as pointed out in the linked issue)
  2. For some reason, the Discord API actually allows private channels as an option type

Thus changes:

  1. Now channel_types will override the input_type's ChannelType
  2. Both discord.ForumChannel and discord.DMChannel are now supported for input_type

Though I can see these some of this being questionable, so do give your thoughts.

@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #1883 (192a086) into master (9da7cf9) will decrease coverage by 0.01%.
The diff coverage is 33.33%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1883      +/-   ##
==========================================
- Coverage   33.27%   33.26%   -0.01%     
==========================================
  Files          96       96              
  Lines       18695    18696       +1     
==========================================
  Hits         6220     6220              
- Misses      12475    12476       +1     
Flag Coverage Δ
macos-latest-3.10 33.25% <33.33%> (-0.01%) ⬇️
macos-latest-3.11 33.25% <33.33%> (-0.01%) ⬇️
macos-latest-3.8 33.26% <33.33%> (-0.01%) ⬇️
macos-latest-3.9 33.26% <33.33%> (-0.01%) ⬇️
ubuntu-latest-3.10 33.25% <33.33%> (-0.01%) ⬇️
ubuntu-latest-3.11 33.25% <33.33%> (-0.01%) ⬇️
ubuntu-latest-3.8 33.26% <33.33%> (-0.01%) ⬇️
ubuntu-latest-3.9 33.26% <33.33%> (-0.01%) ⬇️
windows-latest-3.10 33.25% <33.33%> (-0.01%) ⬇️
windows-latest-3.11 33.25% <33.33%> (-0.01%) ⬇️
windows-latest-3.8 33.26% <33.33%> (-0.01%) ⬇️
windows-latest-3.9 33.26% <33.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
discord/enums.py 79.61% <ø> (ø)
discord/commands/options.py 16.55% <33.33%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9da7cf9...192a086. Read the comment docs.

@NeloBlivion NeloBlivion marked this pull request as ready for review January 18, 2023 00:19
@NeloBlivion NeloBlivion requested a review from a team as a code owner January 18, 2023 00:19
plun1331 and others added 4 commits January 23, 2023 18:05
Co-authored-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com>
Signed-off-by: UK <41271523+NeloBlivion@users.noreply.github.com>
Signed-off-by: UK <41271523+NeloBlivion@users.noreply.github.com>
@plun1331 plun1331 added status: awaiting review Awaiting review from a maintainer feature Implements a feature documentation Improvements or additions to documentation labels Jan 27, 2023
@plun1331 plun1331 enabled auto-merge (squash) January 27, 2023 19:14
@plun1331 plun1331 merged commit 4179b3b into Pycord-Development:master Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature Implements a feature status: awaiting review Awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants