* Add webhook url overload for DiscordWebhookClient Adds an overloaded constructor for `DiscordWebhookClient` which accepts the webhook URL. This URL is parsed using a regex for the id and token. If the token is invalid an `ArgumentException` is thrown. * add null or whitespace check * add some tests for the new DiscordWebhookClient constructor * make the Regex static, specify flags * update regex to look for "discordapp" * specify reason why exception is thrown despite regex match * move parsing logic into new function for testing
36 lines
1.6 KiB
XML
36 lines
1.6 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
<PropertyGroup>
|
|
<OutputType>Exe</OutputType>
|
|
<RootNamespace>Discord</RootNamespace>
|
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
|
<DebugType>portable</DebugType>
|
|
<NoWarn>IDISP001,IDISP002,IDISP004,IDISP005</NoWarn>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<Content Include="xunit.runner.json">
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
</Content>
|
|
</ItemGroup>
|
|
<ItemGroup>
|
|
<None Include="Tests.Permissions.cs" />
|
|
</ItemGroup>
|
|
<ItemGroup>
|
|
<ProjectReference Include="../../src/Discord.Net.Commands/Discord.Net.Commands.csproj" />
|
|
<ProjectReference Include="../../src/Discord.Net.Core/Discord.Net.Core.csproj" />
|
|
<ProjectReference Include="../../src/Discord.Net.Rest/Discord.Net.Rest.csproj" />
|
|
<ProjectReference Include="../../src/Discord.Net.Analyzers/Discord.Net.Analyzers.csproj" />
|
|
<ProjectReference Include="..\..\src\Discord.Net.Webhook\Discord.Net.Webhook.csproj" />
|
|
</ItemGroup>
|
|
<ItemGroup>
|
|
<PackageReference Include="Akavache" Version="6.0.31" />
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
|
<PackageReference Include="xunit" Version="2.4.1" />
|
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
|
<PrivateAssets>all</PrivateAssets>
|
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
|
</PackageReference>
|
|
<PackageReference Include="xunit.runner.reporters" Version="2.4.1" />
|
|
</ItemGroup>
|
|
</Project>
|