diff --git a/src/Discord.Net.Interactions/Builders/ModuleClassBuilder.cs b/src/Discord.Net.Interactions/Builders/ModuleClassBuilder.cs
index 07e62b1f1..faf663304 100644
--- a/src/Discord.Net.Interactions/Builders/ModuleClassBuilder.cs
+++ b/src/Discord.Net.Interactions/Builders/ModuleClassBuilder.cs
@@ -309,8 +309,8 @@ namespace Discord.Interactions.Builders
if (parameters.Count(x => typeof(IModal).IsAssignableFrom(x.ParameterType)) > 1)
throw new InvalidOperationException($"A modal command can only have one {nameof(IModal)} parameter.");
- if (!parameters.All(x => x.ParameterType == typeof(string) || typeof(IModal).IsAssignableFrom(x.ParameterType)))
- throw new InvalidOperationException($"All parameters of a modal command must be either a string or an implementation of {nameof(IModal)}");
+ if (!typeof(IModal).IsAssignableFrom(parameters.Last().ParameterType))
+ throw new InvalidOperationException($"Last parameter of a modal command must be an implementation of {nameof(IModal)}");
var attributes = methodInfo.GetCustomAttributes();
diff --git a/src/Discord.Net.Interactions/Builders/Parameters/ModalCommandParameterBuilder.cs b/src/Discord.Net.Interactions/Builders/Parameters/ModalCommandParameterBuilder.cs
index 276b2e717..8cb9b3ab9 100644
--- a/src/Discord.Net.Interactions/Builders/Parameters/ModalCommandParameterBuilder.cs
+++ b/src/Discord.Net.Interactions/Builders/Parameters/ModalCommandParameterBuilder.cs
@@ -20,6 +20,11 @@ namespace Discord.Interactions.Builders
///
public bool IsModalParameter => Modal is not null;
+ ///
+ /// Gets the assigned to this parameter, if is .
+ ///
+ public TypeReader TypeReader { get; private set; }
+
internal ModalCommandParameterBuilder(ICommandBuilder command) : base(command) { }
///
@@ -35,6 +40,8 @@ namespace Discord.Interactions.Builders
{
if (typeof(IModal).IsAssignableFrom(type))
Modal = ModalUtils.GetOrAdd(type, Command.Module.InteractionService);
+ else
+ TypeReader = Command.Module.InteractionService.GetTypeReader(type);
return base.SetParameterType(type);
}
diff --git a/src/Discord.Net.Interactions/Info/Commands/ModalCommandInfo.cs b/src/Discord.Net.Interactions/Info/Commands/ModalCommandInfo.cs
index 2b9306fda..1934b2293 100644
--- a/src/Discord.Net.Interactions/Info/Commands/ModalCommandInfo.cs
+++ b/src/Discord.Net.Interactions/Info/Commands/ModalCommandInfo.cs
@@ -47,24 +47,40 @@ namespace Discord.Interactions
try
{
- var args = new List