This repository has been archived by the owner on Apr 20, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 42
Interaction Service Complex Parameters #371
Merged
quinchs
merged 17 commits into
Discord-Net-Labs:release/3.x
from
Cenngo:complex-parameters
Dec 23, 2021
Merged
Interaction Service Complex Parameters #371
quinchs
merged 17 commits into
Discord-Net-Labs:release/3.x
from
Cenngo:complex-parameters
Dec 23, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rameterCtor method
MrCakeSlayer
added
Discord .NET v3
Enhancement
New feature or request
Interaction Service
Issues related to the interaction service
Internal
Somthing internal that needs to be changed
labels
Dec 18, 2021
quinchs
suggested changes
Dec 18, 2021
src/Discord.Net.Interactions/Attributes/ComplexParameterAttribute.cs
Outdated
Show resolved
Hide resolved
src/Discord.Net.Interactions/Builders/Parameters/SlashCommandParameterBuilder.cs
Outdated
Show resolved
Hide resolved
src/Discord.Net.Interactions/Builders/Parameters/SlashCommandParameterBuilder.cs
Outdated
Show resolved
Hide resolved
src/Discord.Net.Interactions/Builders/Parameters/SlashCommandParameterBuilder.cs
Outdated
Show resolved
Hide resolved
src/Discord.Net.Interactions/Info/Parameters/SlashCommandParameterInfo.cs
Show resolved
Hide resolved
quinchs
suggested changes
Dec 19, 2021
src/Discord.Net.Interactions/Info/Parameters/SlashCommandParameterInfo.cs
Outdated
Show resolved
Hide resolved
quinchs
approved these changes
Dec 23, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Enhancement
New feature or request
Interaction Service
Issues related to the interaction service
Internal
Somthing internal that needs to be changed
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.
This PR adds a new feature called complex parameters to the Interaction Service. This allows users to create slash command options using an objects constructor. Also allowing complex objects to be created which cannot be infered from only one input value.
Constructor methods support every attribute type that can be used with the regular slash commands ([Autocomplete], [Summary] etc. ).
Preferred constructor of a Type can be specified either by passing a
Type[]
to theComplexParameterAttribute
or tagging a type constructor with theComplexParameterCtorAttribute
. If nothing is specified, the InteractionService defaults to the only public constructor of the type.TypeConverter pattern is used to parse the constructor methods objects.