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

provides fix for #219 #220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mcdaddytalk
Copy link

No description provided.

Copy link
Contributor

@tippfehlr tippfehlr left a comment

Choose a reason for hiding this comment

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

I didn't test it but this seems good.

We have to think about converting all args to strings though: i find it annoying to use const foo = args[n] === 'true' and getBoolean() from discord.js is easier I think.

options.data.forEach(({ value }) => {
args.push(String(value))
})
for (let option of interaction.options.data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a const here

Copy link
Author

Choose a reason for hiding this comment

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

Easy enough to change. Will submit new commit

})
for (let option of interaction.options.data) {
if (option.type === 'SUB_COMMAND' || option.type === 'SUB_COMMAND_GROUP') {
option.options?.forEach(({ value }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like to mix forEach and for in loops but that's personal preference

@mcdaddytalk
Copy link
Author

agreed on questioning converting all args to strings.
line 92: const args: String[] = [] would need to be generic typed to allow for other data types
I can work that out and submit new commit

@tippfehlr
Copy link
Contributor

it's a breaking change so maybe we name it differently until args is deprecated. Isn't necessary though.

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.

2 participants