fix modal text display constructor initialization (#3218)
This commit is contained in:
@@ -133,10 +133,11 @@ namespace Discord.Interactions
|
||||
}
|
||||
break;
|
||||
case TextDisplayComponentInfo textDisplayComponent:
|
||||
{
|
||||
var content = modalInstance is not null ? textDisplayComponent.Getter(modalInstance).ToString() : (textDisplayComponent.DefaultValue as string) ?? textDisplayComponent.Content;
|
||||
var componentBuilder = new TextDisplayBuilder(content);
|
||||
builder.AddTextDisplay(componentBuilder);
|
||||
{
|
||||
var instanceValue = modalInstance is not null ? textDisplayComponent.Getter(modalInstance).ToString() : null;
|
||||
var content = instanceValue ?? (textDisplayComponent.DefaultValue as string) ?? textDisplayComponent.Content;
|
||||
var componentBuilder = new TextDisplayBuilder(content);
|
||||
builder.AddTextDisplay(componentBuilder);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -14,6 +14,6 @@ public class TextDisplayComponentInfo : ModalComponentInfo
|
||||
|
||||
internal TextDisplayComponentInfo(TextDisplayComponentBuilder builder, ModalInfo modal) : base(builder, modal)
|
||||
{
|
||||
Content = Content;
|
||||
Content = builder.Content;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user