Skip to content

Commit 8883596

Browse files
authored
Fix missing SelectMenu Type, ChannelTypes, DefaultValues in ComponentBuilder.AddComponent (#3186)
1 parent 927c905 commit 8883596

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/ComponentBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ internal void AddComponent(IMessageComponent component, int row)
7575
AddComponent(cmp, row);
7676
break;
7777
case SelectMenuComponent menu:
78-
WithSelectMenu(menu.CustomId, menu.Options?.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.IsDefault)).ToList(), menu.Placeholder, menu.MinValues, menu.MaxValues, menu.IsDisabled, row);
78+
WithSelectMenu(menu.CustomId, menu.Options?.Select(x => new SelectMenuOptionBuilder(x.Label, x.Value, x.Description, x.Emote, x.IsDefault)).ToList(), menu.Placeholder, menu.MinValues, menu.MaxValues, menu.IsDisabled, row, menu.Type, menu.ChannelTypes.ToArray(), menu.DefaultValues.ToArray());
7979
break;
8080
}
8181
}

src/Discord.Net.Rest/Net/Converters/MessageComponentConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
3636
case ComponentType.MentionableSelect:
3737
case ComponentType.RoleSelect:
3838
case ComponentType.UserSelect:
39-
messageComponent = new API.SelectMenuComponent();
39+
messageComponent = new API.SelectMenuComponent(){Type = (ComponentType)typeProperty};
4040
break;
4141
case ComponentType.TextInput:
4242
messageComponent = new API.TextInputComponent();

0 commit comments

Comments
 (0)