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

Reworked get_application_command behaviour #1678

Merged
merged 9 commits into from Oct 17, 2022

Conversation

NeloBlivion
Copy link
Member

@NeloBlivion NeloBlivion commented Oct 8, 2022

Summary

type now defaults to ApplicationCommand, allowing users to get any command type by default instead of just SlashCommand. While changing defaults without warning could be considered breaking, all command names must already be unique and as such changing the default type would have no effect unless, for some reason, the user was intentionally getting None while using an existing command name.

The main addition here is support for qualified command names to easily get subgroups/subcommands, similar to how get_command works on ext.commands.Bot. This search occurs if they input a somewhat valid qualified name, only validating if it's all lowercase and exactly two or three words (e.g. group subcommand or group subgroup subcommand would both be valid.)

Closes #1625

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.

@Lulalaby Lulalaby enabled auto-merge (squash) October 8, 2022 04:25
Lulalaby
Lulalaby previously approved these changes Oct 8, 2022
@Lulalaby Lulalaby requested a review from Dorukyum October 8, 2022 04:26
discord/bot.py Outdated Show resolved Hide resolved
@Lulalaby Lulalaby added priority: medium Medium Priority bug Something isn't working feature Implements a feature labels Oct 11, 2022
@Lulalaby
Copy link
Member

ping pong

@codecov
Copy link

codecov bot commented Oct 16, 2022

Codecov Report

Merging #1678 (7c9e939) into master (c062339) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1678      +/-   ##
==========================================
- Coverage   33.25%   33.23%   -0.02%     
==========================================
  Files          95       95              
  Lines       18412    18423      +11     
==========================================
  Hits         6123     6123              
- Misses      12289    12300      +11     
Flag Coverage Δ
pytest 33.23% <0.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
discord/bot.py 18.31% <0.00%> (-0.45%) ⬇️

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 c062339...7c9e939. Read the comment docs.

auto-merge was automatically disabled October 16, 2022 19:16

Head branch was pushed to by a user without write access

@BobDotCom BobDotCom enabled auto-merge (squash) October 17, 2022 17:52
@BobDotCom BobDotCom merged commit 80941fe into Pycord-Development:master Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature Implements a feature priority: medium Medium Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't get the ID of a slash subcommand
4 participants