| @@ -6,6 +6,7 @@ using System.Runtime.CompilerServices; | |||||
| [assembly: InternalsVisibleTo("Discord.Net.Commands")] | [assembly: InternalsVisibleTo("Discord.Net.Commands")] | ||||
| [assembly: InternalsVisibleTo("Discord.Net.Tests")] | [assembly: InternalsVisibleTo("Discord.Net.Tests")] | ||||
| [assembly: InternalsVisibleTo("Discord.Net.Tests.Unit")] | [assembly: InternalsVisibleTo("Discord.Net.Tests.Unit")] | ||||
| [assembly: InternalsVisibleTo("Discord.Net.Tests.Integration")] | |||||
| [assembly: InternalsVisibleTo("Discord.Net.Interactions")] | [assembly: InternalsVisibleTo("Discord.Net.Interactions")] | ||||
| [assembly: TypeForwardedTo(typeof(Discord.Embed))] | [assembly: TypeForwardedTo(typeof(Discord.Embed))] | ||||
| @@ -132,12 +132,15 @@ namespace Discord.Rest | |||||
| } | } | ||||
| public static ulong GetUploadLimit(IGuild guild) | public static ulong GetUploadLimit(IGuild guild) | ||||
| { | { | ||||
| return guild.PremiumTier switch | |||||
| var tierFactor = guild.PremiumTier switch | |||||
| { | { | ||||
| PremiumTier.Tier2 => 50ul * 1000000, | |||||
| PremiumTier.Tier3 => 100ul * 1000000, | |||||
| _ => 8ul * 1000000 | |||||
| PremiumTier.Tier2 => 50, | |||||
| PremiumTier.Tier3 => 100, | |||||
| _ => 8 | |||||
| }; | }; | ||||
| var mebibyte = Math.Pow(2, 20); | |||||
| return (ulong) (tierFactor * mebibyte); | |||||
| } | } | ||||
| #endregion | #endregion | ||||
| @@ -151,7 +154,7 @@ namespace Discord.Rest | |||||
| if (fromUserId.HasValue) | if (fromUserId.HasValue) | ||||
| return GetBansAsync(guild, client, fromUserId.Value + 1, Direction.Before, around + 1, options) | return GetBansAsync(guild, client, fromUserId.Value + 1, Direction.Before, around + 1, options) | ||||
| .Concat(GetBansAsync(guild, client, fromUserId.Value, Direction.After, around, options)); | .Concat(GetBansAsync(guild, client, fromUserId.Value, Direction.After, around, options)); | ||||
| else | |||||
| else | |||||
| return GetBansAsync(guild, client, null, Direction.Before, around + 1, options); | return GetBansAsync(guild, client, null, Direction.Before, around + 1, options); | ||||
| } | } | ||||
| @@ -908,7 +911,7 @@ namespace Discord.Rest | |||||
| if (endTime != null && endTime <= startTime) | if (endTime != null && endTime <= startTime) | ||||
| throw new ArgumentOutOfRangeException(nameof(endTime), $"{nameof(endTime)} cannot be before the start time"); | throw new ArgumentOutOfRangeException(nameof(endTime), $"{nameof(endTime)} cannot be before the start time"); | ||||
| var apiArgs = new CreateGuildScheduledEventParams() | var apiArgs = new CreateGuildScheduledEventParams() | ||||
| { | { | ||||
| ChannelId = channelId ?? Optional<ulong>.Unspecified, | ChannelId = channelId ?? Optional<ulong>.Unspecified, | ||||
| @@ -14,6 +14,7 @@ | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <PackageReference Include="FluentAssertions" Version="6.7.0" /> | |||||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | ||||
| <PackageReference Include="xunit" Version="2.4.1" /> | <PackageReference Include="xunit" Version="2.4.1" /> | ||||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | ||||
| @@ -12,7 +12,9 @@ | |||||
| <ProjectReference Include="../../src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj" /> | <ProjectReference Include="../../src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj" /> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <PackageReference Include="FluentAssertions" Version="6.7.0" /> | |||||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | ||||
| <PackageReference Include="Moq" Version="4.18.1" /> | |||||
| <PackageReference Include="xunit" Version="2.4.1" /> | <PackageReference Include="xunit" Version="2.4.1" /> | ||||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | ||||
| <PrivateAssets>all</PrivateAssets> | <PrivateAssets>all</PrivateAssets> | ||||