Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Interaction Service Complex Parameters #371

Merged
merged 17 commits into from
Dec 23, 2021

Conversation

Cenngo
Copy link
Contributor

@Cenngo Cenngo commented Dec 12, 2021

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 the ComplexParameterAttribute or tagging a type constructor with the ComplexParameterCtorAttribute. 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.

This PR is ready to be merged but it changes the way SlashCommandParameters are parsed on execution, so i dont think this change should be included in the D-Net v3 roll out.

image
image
image

@Cenngo Cenngo marked this pull request as ready for review December 14, 2021 20:39
@MrCakeSlayer 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 quinchs merged commit 977a7d5 into Discord-Net-Labs:release/3.x 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants