Isolated API definitions to their own library
This commit is contained in:
8
src/Discord.Net.API/AssemblyInfo.cs
Normal file
8
src/Discord.Net.API/AssemblyInfo.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Discord.Net.Core")]
|
||||
[assembly: InternalsVisibleTo("Discord.Net.Rest")]
|
||||
[assembly: InternalsVisibleTo("Discord.Net.Rpc")]
|
||||
[assembly: InternalsVisibleTo("Discord.Net.WebSocket")]
|
||||
[assembly: InternalsVisibleTo("Discord.Net.Commands")]
|
||||
[assembly: InternalsVisibleTo("Discord.Net.Tests")]
|
||||
29
src/Discord.Net.API/Discord.Net.API.csproj
Normal file
29
src/Discord.Net.API/Discord.Net.API.csproj
Normal file
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<Description>A collection of Discord API definitions for use by Discord.Net.</Description>
|
||||
<VersionPrefix>1.0.0-beta2</VersionPrefix>
|
||||
<TargetFrameworks>netstandard1.1</TargetFrameworks>
|
||||
<AssemblyName>Discord.Net.API</AssemblyName>
|
||||
<PackageTags>discord;discordapp</PackageTags>
|
||||
<PackageProjectUrl>https://github.com/RogueException/Discord.Net</PackageProjectUrl>
|
||||
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>git://github.com/RogueException/Discord.Net.API</RepositoryUrl>
|
||||
<RootNamespace>Discord</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
<EmbeddedResource Include="**\*.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
||||
<PackageReference Include="System.Reflection" Version="4.3.0" />
|
||||
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
|
||||
<PackageReference Include="System.Runtime" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<NoWarn>$(NoWarn);CS1573;CS1591</NoWarn>
|
||||
<WarningsAsErrors>true</WarningsAsErrors>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -13,10 +13,7 @@ namespace Discord.API.Gateway
|
||||
|
||||
[JsonProperty("guild_id")]
|
||||
public ulong? GuildId { get; set; }
|
||||
public IGuild Guild { set { GuildId = value?.Id; } }
|
||||
|
||||
[JsonProperty("channel_id")]
|
||||
public ulong? ChannelId { get; set; }
|
||||
public IChannel Channel { set { ChannelId = value?.Id; } }
|
||||
}
|
||||
}
|
||||
@@ -17,17 +17,5 @@ namespace Discord.API
|
||||
Stream = null;
|
||||
Hash = hash;
|
||||
}
|
||||
|
||||
internal static Image Create(Discord.Image image)
|
||||
{
|
||||
return new Image(image.Stream);
|
||||
}
|
||||
internal static Image? Create(Discord.Image? image)
|
||||
{
|
||||
if (image.HasValue)
|
||||
return new Image(image.Value.Stream);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user