Skip to content

Commit 00cb8dc

Browse files
committed
add null forgiving operator to channel type mapping
1 parent a59db13 commit 00cb8dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Discord.Net.Interactions/Extensions/IDiscordInteractionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static async Task<Modal> ToModalAsync<T>(this IDiscordInteraction interac
105105
case SnowflakeSelectComponentInfo snowflakeSelectComponent:
106106
{
107107
var channelTypes = snowflakeSelectComponent is ChannelSelectComponentInfo channelSelectComponent ? channelSelectComponent.ChannelTypes : null;
108-
var inputBuilder = new SelectMenuBuilder(snowflakeSelectComponent.CustomId, null, snowflakeSelectComponent.Placeholder, snowflakeSelectComponent.MaxValues, snowflakeSelectComponent.MinValues, false, snowflakeSelectComponent.ComponentType, [..channelTypes], snowflakeSelectComponent.DefaultValues.ToList(), null, snowflakeSelectComponent.IsRequired);
108+
var inputBuilder = new SelectMenuBuilder(snowflakeSelectComponent.CustomId, null, snowflakeSelectComponent.Placeholder, snowflakeSelectComponent.MaxValues, snowflakeSelectComponent.MinValues, false, snowflakeSelectComponent.ComponentType, channelTypes?.ToList(), snowflakeSelectComponent.DefaultValues.ToList(), null, snowflakeSelectComponent.IsRequired);
109109

110110
var instanceValue = modalInstance is not null ? snowflakeSelectComponent.Getter(modalInstance) : null;
111111
await snowflakeSelectComponent.TypeConverter.WriteAsync(inputBuilder, interaction, snowflakeSelectComponent, instanceValue);

0 commit comments

Comments
 (0)