From 7c96844f17c2bb8343477e46b9070616ca6631cd Mon Sep 17 00:00:00 2001 From: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:51:31 +0300 Subject: [PATCH] [Fix] Allow setting channel topic to null when creating channels (#2849) --- .github/workflows/dotnet.yml | 6 +++--- src/Discord.Net.Rest/DiscordRestApiClient.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 4020021265..74fc938d8e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -119,12 +119,12 @@ jobs: - name: Push Nightly if: vars.PUSH_NIGHTLY == 'true' - run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ vars.NIGHTLY_FEED }} + run: nuget push "${{ env.ArtifactStagingDirectory }}/*.nupkg" -Source ${{ vars.NIGHTLY_FEED }} - name: Push Nightly to GitHub Pacakges if: vars.PUSH_NIGHTLY == 'true' - run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ env.REPOSITORY_URL }} + run: nuget push "${{ env.ArtifactStagingDirectory }}/*.nupkg" -Source ${{ env.REPOSITORY_URL }} - name: Push Release if: env.IsTagBuild == 'true' && vars.PUSH_NUGET == 'true' - run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source https://api.nuget.org/v3/index.json + run: nuget push "${{ env.ArtifactStagingDirectory }}/*.nupkg" -Source https://api.nuget.org/v3/index.json diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 4f9d644d97..c5f13314b3 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -370,7 +370,7 @@ public Task CreateGuildChannelAsync(ulong guildId, CreateGuildChannelPa Preconditions.GreaterThan(args.Bitrate, 0, nameof(args.Bitrate)); Preconditions.NotNullOrWhitespace(args.Name, nameof(args.Name)); Preconditions.AtMost(args.Name.Length, 100, nameof(args.Name)); - if (args.Topic.IsSpecified) + if (args.Topic is { IsSpecified: true, Value: not null }) Preconditions.AtMost(args.Topic.Value.Length, 1024, nameof(args.Name)); options = RequestOptions.CreateOrClone(options);