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

refactor(CommandInteractionOptionResolver): remove getFull from getFocused() #9789

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ImRodry
Copy link
Contributor

@ImRodry ImRodry commented Aug 20, 2023

Please describe the changes this PR makes and why it should be merged:
This PR removes the argument for getFull in CommandInteractionOptionResolver#getFocused and instead makes the function always return the full object. This change was discussed in a thread in the DJS Discord server and the reason I am opening this PR is because I personally have never found a use case where I don't need the name of the option, and everyone should always check that property in their code in order to future-proof it in the event that a command ever gets 2 options with autocomplete with different names and different behaviors. I am also open to feedback as another option I considered in that thread was to change the default of this parameter to true instead of false, thus leaving this shortcut for the people that want to be less safe about their code but still making the default the recommended and more common behavior.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@ImRodry ImRodry requested a review from a team as a code owner August 20, 2023 15:39
@vercel
Copy link

vercel bot commented Aug 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2023 3:42pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2023 3:42pm

@github-actions
Copy link

github-actions bot commented Aug 20, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 94
🟢 Accessibility 97
🟢 Best practices 100
🟠 SEO 75
🔴 PWA 30

Lighthouse ran on https://discord-js-git-fork-imrodry-refactor-remove-getfull-discordjs.vercel.app/

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

None yet

5 participants