Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

feat(SlashCommandBuilder): add autocomplete #42

Closed
wants to merge 1 commit into from

Conversation

Khasms
Copy link
Contributor

@Khasms Khasms commented Sep 23, 2021

Please describe the changes this PR makes and why it should be merged:
Adds support for autocompletion. This is a draft because I can't figure out the types to make choices and autocomplete exclusive, so any help on this front would be appreciated. I will add tests once the types are figured out.

Relevant links:

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • This PR changes the library's interface (methods or parameters added)

@codecov-commenter
Copy link

Codecov Report

Merging #42 (ea5daeb) into main (c0f7993) will decrease coverage by 1.27%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##              main      #42      +/-   ##
===========================================
- Coverage   100.00%   98.72%   -1.28%     
===========================================
  Files           18       18              
  Lines          233      236       +3     
  Branches        33       33              
===========================================
  Hits           233      233              
- Misses           0        3       +3     
Impacted Files Coverage Δ
...s/slashCommands/mixins/CommandOptionWithChoices.ts 83.33% <0.00%> (-16.67%) ⬇️

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 c0f7993...ea5daeb. Read the comment docs.

Copy link
Member

@suneettipirneni suneettipirneni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also include some form of validation in toJSON that checks that if autocomplete is set to true, choices are not present, and if it's set to false or undefined, then it allows choices.

@Khasms
Copy link
Contributor Author

Khasms commented Sep 23, 2021

This should also include some form of validation in toJSON that checks that if autocomplete is set to true, choices are not present, and if it's set to false or undefined, then it allows choices.

I don't think this is needed because having proper return types that exclude the non-allowed methods is the most that has been done in the rest of the package. However, as I said in the PR description, I can't figure out how to make the types work.

@Khasms Khasms closed this Oct 27, 2021
@Khasms Khasms deleted the feat/autocomplete branch November 30, 2021 20:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants