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

Argument parsing for commands #136

Merged
merged 24 commits into from
Apr 30, 2021
Merged

Argument parsing for commands #136

merged 24 commits into from
Apr 30, 2021

Conversation

MierenManz
Copy link
Contributor

@MierenManz MierenManz commented Apr 27, 2021

About

Implements the feature request of #134

Status

Not done!

  • These changes have been tested against Discord API or contain no API change.

  • This PR introduces some Breaking changes.

  • Add parser

  • Intergrate parser into message processing

  • Add dynamic return type

src/utils/command.ts Outdated Show resolved Hide resolved
@DjDeveloperr
Copy link
Member

Suggestion: What about adding unit tests for args parsing? It would be useful for things like edge cases.

@MierenManz
Copy link
Contributor Author

Suggestion: What about adding unit tests for args parsing? It would be useful for things like edge cases.

I wouldn't really know how that test would look like?
Maybe add all 4 matches and supply some random string of input and assertEqual against what it should be?

@MierenManz
Copy link
Contributor Author

Suggestion: What about adding unit tests for args parsing? It would be useful for things like edge cases.

This is now added and I feel like the pr is ready for the final review now

@MierenManz MierenManz changed the title [WIP] Argument parsing for commands Argument parsing for commands Apr 28, 2021
Copy link
Member

@Helloyunho Helloyunho left a comment

Choose a reason for hiding this comment

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

lgtm!

@MierenManz
Copy link
Contributor Author

these were my last changes, imo ready to be landed 🚀

Copy link
Member

@DjDeveloperr DjDeveloperr left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉 I think rest would be more useful if it was string instead of string[]

@MierenManz
Copy link
Contributor Author

LGTM! 🎉 I think rest would be more useful if it was string instead of string[]

I can fix that for sure. then it's good to land I feel like

@DjDeveloperr
Copy link
Member

then it's good to land I feel like

Yes.

@MierenManz MierenManz mentioned this pull request Apr 30, 2021
@Helloyunho Helloyunho merged commit 60e7c75 into harmonyland:main Apr 30, 2021
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.

None yet

3 participants