Skip to content

Commit

Permalink
Merge branch 'main' into cleanup/nullability-and-other-things
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Sep 18, 2023
2 parents 8485521 + f60dc77 commit 742e9ec
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 141 deletions.

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions DisCatSharp.ApplicationCommands/Workers/RegistrationWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,7 @@ private static (
/// <returns>A list of command ids.</returns>
private static List<ulong>? BuildGlobalDeleteList(IReadOnlyCollection<DiscordApplicationCommand>? updateList = null)
{
if (ApplicationCommandsExtension.GlobalDiscordCommands == null || !ApplicationCommandsExtension.GlobalDiscordCommands.Any()
|| ApplicationCommandsExtension.GlobalDiscordCommands == null
)
if (ApplicationCommandsExtension.GlobalDiscordCommands == null || !ApplicationCommandsExtension.GlobalDiscordCommands.Any())
return null;

var discord = ApplicationCommandsExtension.GlobalDiscordCommands;
Expand Down Expand Up @@ -472,9 +470,7 @@ private static (
List<DiscordApplicationCommand>? unchangedCommands
) BuildGlobalOverwriteList(DiscordClient client, List<DiscordApplicationCommand>? updateList)
{
if (ApplicationCommandsExtension.GlobalDiscordCommands == null || !ApplicationCommandsExtension.GlobalDiscordCommands.Any()
|| updateList == null || ApplicationCommandsExtension.GlobalDiscordCommands == null
)
if (ApplicationCommandsExtension.GlobalDiscordCommands == null || !ApplicationCommandsExtension.GlobalDiscordCommands.Any() || updateList == null)
return (null, null);

var discord = ApplicationCommandsExtension.GlobalDiscordCommands;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions DisCatSharp.Hosting.Tests/DisCatSharp.Hosting.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions DisCatSharp.Tests/SafetyTests/DisCatSharp.SafetyTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.7.0" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
9 changes: 3 additions & 6 deletions DisCatSharp/Net/Rest/DiscordApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5626,8 +5626,7 @@ internal async Task<IReadOnlyList<DiscordApplicationCommand>> BulkOverwriteGuild
DefaultMemberPermission = command.DefaultMemberPermissions,
DmPermission = command.DmPermission,
Nsfw = command.IsNsfw,
AllowedContexts = command.AllowedContexts,
IntegrationTypes = command.IntegrationTypes
AllowedContexts = command.AllowedContexts
});

var route = $"{Endpoints.APPLICATIONS}/:application_id{Endpoints.GUILDS}/:guild_id{Endpoints.COMMANDS}";
Expand Down Expand Up @@ -5663,8 +5662,7 @@ internal async Task<DiscordApplicationCommand> CreateGuildApplicationCommandAsyn
DefaultMemberPermission = command.DefaultMemberPermissions,
DmPermission = command.DmPermission,
Nsfw = command.IsNsfw,
AllowedContexts = command.AllowedContexts,
IntegrationTypes = command.IntegrationTypes
AllowedContexts = command.AllowedContexts
};

var route = $"{Endpoints.APPLICATIONS}/:application_id{Endpoints.GUILDS}/:guild_id{Endpoints.COMMANDS}";
Expand Down Expand Up @@ -5739,8 +5737,7 @@ internal async Task<DiscordApplicationCommand> EditGuildApplicationCommandAsync(
NameLocalizations = nameLocalization.Map(l => l.GetKeyValuePairs()).ValueOrDefault(),
DescriptionLocalizations = descriptionLocalization.Map(l => l.GetKeyValuePairs()).ValueOrDefault(),
Nsfw = isNsfw,
AllowedContexts = allowedContexts,
IntegrationTypes = integrationTypes
AllowedContexts = allowedContexts
};

var route =
Expand Down

0 comments on commit 742e9ec

Please sign in to comment.