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

feat: add support for chat input command arguments #646

Closed
wants to merge 4 commits into from

Conversation

Arcadia148
Copy link

@Arcadia148 Arcadia148 commented Jul 13, 2023

This PR is my attempt at adding support for chat input arguments

The basic way this will work is;

You can register the command option type to match the argument. e.g. Channel for channel related arguments.

// 'channel' being the name of the option so we can use getChannel.
const channel = await args.pick('guildTextChannel', 'channel');

Or you can register the command option type as string and use:

// once again 'channel' being the name of the option so we can use getString.
const channel = await args.pick('guildTextChannel', 'channel', { useStringResolver: true });

Remarks

I only really thought it made sense to include the "pick" and "repeat" functions on ChatInputArgs, So i did not include others.

There most likely is a better way to implement this, but idk.

also a few simple changes will have to be made to packages like subcommands to support this ;)

PR closes #494

feat: Add support for Chat Input Command Arguments
@Arcadia148 Arcadia148 marked this pull request as draft July 16, 2023 11:59
@Arcadia148 Arcadia148 marked this pull request as ready for review July 16, 2023 16:37
@favna
Copy link
Member

favna commented Aug 28, 2023

In lieue of a response from @vladfrangu who has told me in DM (and I quote):

I'm not a fan of it at all
but
I also dont wanna be like "no thanks close"

(Likewise, I'm not a fan that he doesn't just tell you and leaves the PR unanswered, there is avoiding confrontation and there is extremes haha)

I'm just updating you that we'll keep this PR open, but not much done with it right now.
Furthermore, @vladfrangu has also said:

bc I want to make args have a consistent interface between types
Basically make Args an interface now
and then MessageArgs/ChatInputCommandArgs implement it
and then people can just
use it
without thinking of what they are using it in
also it's hella breaking LOL sapphire v5 lets GOO

If you can instead provide an implementation that matches those wishes from Vladdy then we can further review this PR. Most importantly to keep in mind that you're free to introduce breaking changes.

@Arcadia148
Copy link
Author

Apologies for the late response haha. I personally also thought this was not really a good implementation, although more so after a week or so when i looked back over it.

Unfortunately, i doubt i will provide an implementation fulfilling the requirements. So i will close this PR.

Good luck and thanks for the awesome framework!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

request: update Args to support Chat Input commands
2 participants