[DRAFT] feat(interaction): added user option to command options #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a
UserOption
to allow slash commands to select and target users.This is a draft currently, as (a) I'm still ramping up on Swift (making a Discord bot is my first real use of it), and (b) while this functions, it is less than ideal, as the interaction data provides all of the user information but this currently only gives the ID to consuming code. Ideally, it should pull out the user data and make it available to users of the package nicely, but for now it's working as an MVP so I can actually use it.
As to why I've opened the PR, mostly it's so I can get a 'no don't do that' early on if I'm going down the wrong path, and possibly to look at expanding it out to adding more of the options as well.
I've also tweaked the
BotMessage
class as well, since there's a lot of useful info in theMessage
that seems to get thrown away (e.g. I want access to the author ID, as I want to filter out messages created by the bot itself when using thecreateChannelMsg
method). If this isn't wanted, I'll revert it, not exactly attached to it.For future reference (mostly for myself), this is an example interaction object (with all sensitive values stripped out):
Interaction Object