diff --git a/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs b/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs
index 377d6730..37522633 100644
--- a/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs
+++ b/src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs
@@ -68,8 +68,13 @@ namespace Discord.Interactions
{
case TextInputComponentInfo textComponent:
{
+ var boxedValue = textComponent.Getter(modal);
+ var value = textComponent.TypeOverridesToString
+ ? boxedValue.ToString()
+ : boxedValue as string;
+
builder.AddTextInput(textComponent.Label, textComponent.CustomId, textComponent.Style, textComponent.Placeholder, textComponent.IsRequired ? textComponent.MinLength : null,
- textComponent.MaxLength, textComponent.IsRequired, textComponent.Getter(modal) as string);
+ textComponent.MaxLength, textComponent.IsRequired, value);
}
break;
default:
diff --git a/src/Discord.Net.Interactions/Info/InputComponents/TextInputComponentInfo.cs b/src/Discord.Net.Interactions/Info/InputComponents/TextInputComponentInfo.cs
index 613549fe..6831c795 100644
--- a/src/Discord.Net.Interactions/Info/InputComponents/TextInputComponentInfo.cs
+++ b/src/Discord.Net.Interactions/Info/InputComponents/TextInputComponentInfo.cs
@@ -1,3 +1,5 @@
+using System;
+
namespace Discord.Interactions
{
///
@@ -5,6 +7,12 @@ namespace Discord.Interactions
///
public class TextInputComponentInfo : InputComponentInfo
{
+ ///
+ /// true when overrides .
+ ///
+ internal bool TypeOverridesToString => _typeOverridesToString.Value;
+ private readonly Lazy _typeOverridesToString;
+
///
/// Gets the style of the text input.
///
@@ -37,6 +45,8 @@ namespace Discord.Interactions
MinLength = builder.MinLength;
MaxLength = builder.MaxLength;
InitialValue = builder.InitialValue;
+
+ _typeOverridesToString = new(() => ReflectionUtils