Made API models internal. Removed Discord.Net.API.

This commit is contained in:
RogueException
2017-01-01 23:28:42 -04:00
parent dac51db299
commit e2934abe29
244 changed files with 641 additions and 473 deletions

View File

@@ -1,8 +0,0 @@
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")]

View File

@@ -1,4 +1,4 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Description>A Discord.Net extension adding support for bot commands.</Description> <Description>A Discord.Net extension adding support for bot commands.</Description>
<VersionPrefix>1.0.0-beta2</VersionPrefix> <VersionPrefix>1.0.0-beta2</VersionPrefix>
@@ -16,7 +16,6 @@
<EmbeddedResource Include="**\*.resx" /> <EmbeddedResource Include="**\*.resx" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Discord.Net.API\Discord.Net.API.csproj" />
<ProjectReference Include="..\Discord.Net.Core\Discord.Net.Core.csproj" /> <ProjectReference Include="..\Discord.Net.Core\Discord.Net.Core.csproj" />
</ItemGroup> </ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">

View File

@@ -10,7 +10,7 @@ namespace Discord.Commands
{ {
public T Context { get; private set; } public T Context { get; private set; }
protected virtual async Task<IUserMessage> ReplyAsync(string message, bool isTTS = false, EmbedBuilder embed = null, RequestOptions options = null) protected virtual async Task<IUserMessage> ReplyAsync(string message, bool isTTS = false, Embed embed = null, RequestOptions options = null)
{ {
return await Context.Channel.SendMessageAsync(message, isTTS, embed, options).ConfigureAwait(false); return await Context.Channel.SendMessageAsync(message, isTTS, embed, options).ConfigureAwait(false);
} }

View File

@@ -0,0 +1,8 @@
using System.IO;
namespace Discord.Audio
{
public abstract class AudioInStream : Stream
{
}
}

View File

@@ -15,9 +15,6 @@
<Compile Include="**\*.cs" /> <Compile Include="**\*.cs" />
<EmbeddedResource Include="**\*.resx" /> <EmbeddedResource Include="**\*.resx" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Discord.Net.API\Discord.Net.API.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" /> <PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />

View File

@@ -1,5 +1,4 @@
using Discord.API.Rest; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@@ -8,7 +8,7 @@ namespace Discord
public interface IMessageChannel : IChannel public interface IMessageChannel : IChannel
{ {
/// <summary> Sends a message to this message channel. </summary> /// <summary> Sends a message to this message channel. </summary>
Task<IUserMessage> SendMessageAsync(string text, bool isTTS = false, EmbedBuilder embed = null, RequestOptions options = null); Task<IUserMessage> SendMessageAsync(string text, bool isTTS = false, Embed embed = null, RequestOptions options = null);
#if NETSTANDARD1_3 #if NETSTANDARD1_3
/// <summary> Sends a file to this text channel, with an optional caption. </summary> /// <summary> Sends a file to this text channel, with an optional caption. </summary>
Task<IUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, RequestOptions options = null); Task<IUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, RequestOptions options = null);

View File

@@ -1,5 +1,4 @@
using Discord.API.Rest; using System;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Discord namespace Discord

View File

@@ -1,5 +1,4 @@
using Discord.API.Rest; using Discord.Audio;
using Discord.Audio;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@@ -1,7 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.Emoji;
namespace Discord namespace Discord
{ {
@@ -14,7 +12,7 @@ namespace Discord
public bool RequireColons { get; } public bool RequireColons { get; }
public IReadOnlyList<ulong> RoleIds { get; } public IReadOnlyList<ulong> RoleIds { get; }
private GuildEmoji(ulong id, string name, bool isManaged, bool requireColons, IReadOnlyList<ulong> roleIds) internal GuildEmoji(ulong id, string name, bool isManaged, bool requireColons, IReadOnlyList<ulong> roleIds)
{ {
Id = id; Id = id;
Name = name; Name = name;
@@ -22,10 +20,6 @@ namespace Discord
RequireColons = requireColons; RequireColons = requireColons;
RoleIds = roleIds; RoleIds = roleIds;
} }
internal static GuildEmoji Create(Model model)
{
return new GuildEmoji(model.Id.Value, model.Name, model.Managed, model.RequireColons, ImmutableArray.Create(model.Roles));
}
public override string ToString() => Name; public override string ToString() => Name;
private string DebuggerDisplay => $"{Name} ({Id})"; private string DebuggerDisplay => $"{Name} ({Id})";

View File

@@ -1,5 +1,4 @@
using Discord.API.Rest; using Discord.Audio;
using Discord.Audio;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@@ -1,6 +1,4 @@
using System.IO; using System.IO;
using Model = Discord.API.Image;
namespace Discord namespace Discord
{ {
/// <summary> /// <summary>
@@ -30,10 +28,5 @@ namespace Discord
Stream = File.OpenRead(path); Stream = File.OpenRead(path);
} }
#endif #endif
public Model ToModel()
{
return new Model(Stream);
}
} }
} }

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Immutable;
using System.Diagnostics;
namespace Discord
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class Embed : IEmbed
{
public string Type { get; }
public string Description { get; internal set; }
public string Url { get; internal set; }
public string Title { get; internal set; }
public DateTimeOffset? Timestamp { get; internal set; }
public Color? Color { get; internal set; }
public EmbedImage? Image { get; internal set; }
public EmbedVideo? Video { get; internal set; }
public EmbedAuthor? Author { get; internal set; }
public EmbedFooter? Footer { get; internal set; }
public EmbedProvider? Provider { get; internal set; }
public EmbedThumbnail? Thumbnail { get; internal set; }
public ImmutableArray<EmbedField> Fields { get; internal set; }
internal Embed(string type)
{
Type = type;
Fields = ImmutableArray.Create<EmbedField>();
}
internal Embed(string type,
string title,
string description,
string url,
DateTimeOffset? timestamp,
Color? color,
EmbedImage? image,
EmbedVideo? video,
EmbedAuthor? author,
EmbedFooter? footer,
EmbedProvider? provider,
EmbedThumbnail? thumbnail,
ImmutableArray<EmbedField> fields)
{
Type = type;
Title = title;
Description = description;
Url = url;
Color = color;
Timestamp = timestamp;
Image = image;
Video = video;
Author = author;
Footer = footer;
Provider = provider;
Thumbnail = thumbnail;
Fields = fields;
}
public override string ToString() => Title;
private string DebuggerDisplay => $"{Title} ({Type})";
}
}

View File

@@ -1,27 +1,22 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.EmbedAuthor;
namespace Discord namespace Discord
{ {
[DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedAuthor public struct EmbedAuthor
{ {
public string Name { get; set; } public string Name { get; internal set; }
public string Url { get; set; } public string Url { get; internal set; }
public string IconUrl { get; set; } public string IconUrl { get; internal set; }
public string ProxyIconUrl { get; set; } public string ProxyIconUrl { get; internal set; }
private EmbedAuthor(string name, string url, string iconUrl, string proxyIconUrl) internal EmbedAuthor(string name, string url, string iconUrl, string proxyIconUrl)
{ {
Name = name; Name = name;
Url = url; Url = url;
IconUrl = iconUrl; IconUrl = iconUrl;
ProxyIconUrl = proxyIconUrl; ProxyIconUrl = proxyIconUrl;
} }
internal static EmbedAuthor Create(Model model)
{
return new EmbedAuthor(model.Name, model.Url, model.IconUrl, model.ProxyIconUrl);
}
private string DebuggerDisplay => $"{Name} ({Url})"; private string DebuggerDisplay => $"{Name} ({Url})";
public override string ToString() => Name; public override string ToString() => Name;

View File

@@ -1,25 +1,20 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.EmbedField;
namespace Discord namespace Discord
{ {
[DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedField public struct EmbedField
{ {
public string Name { get; set; } public string Name { get; internal set; }
public string Value { get; set; } public string Value { get; internal set; }
public bool Inline { get; set; } public bool Inline { get; internal set; }
private EmbedField(string name, string value, bool inline) internal EmbedField(string name, string value, bool inline)
{ {
Name = name; Name = name;
Value = value; Value = value;
Inline = inline; Inline = inline;
} }
internal static EmbedField Create(Model model)
{
return new EmbedField(model.Name, model.Value, model.Inline);
}
private string DebuggerDisplay => $"{Name} ({Value}"; private string DebuggerDisplay => $"{Name} ({Value}";
public override string ToString() => Name; public override string ToString() => Name;

View File

@@ -1,25 +1,20 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.EmbedFooter;
namespace Discord namespace Discord
{ {
[DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedFooter public struct EmbedFooter
{ {
public string Text { get; set; } public string Text { get; internal set; }
public string IconUrl { get; set; } public string IconUrl { get; internal set; }
public string ProxyUrl { get; set; } public string ProxyUrl { get; internal set; }
private EmbedFooter(string text, string iconUrl, string proxyUrl) internal EmbedFooter(string text, string iconUrl, string proxyUrl)
{ {
Text = text; Text = text;
IconUrl = iconUrl; IconUrl = iconUrl;
ProxyUrl = proxyUrl; ProxyUrl = proxyUrl;
} }
internal static EmbedFooter Create(Model model)
{
return new EmbedFooter(model.Text, model.IconUrl, model.ProxyIconUrl);
}
private string DebuggerDisplay => $"{Text} ({IconUrl})"; private string DebuggerDisplay => $"{Text} ({IconUrl})";
public override string ToString() => Text; public override string ToString() => Text;

View File

@@ -1,5 +1,4 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.EmbedImage;
namespace Discord namespace Discord
{ {
@@ -11,19 +10,13 @@ namespace Discord
public int? Height { get; } public int? Height { get; }
public int? Width { get; } public int? Width { get; }
private EmbedImage(string url, string proxyUrl, int? height, int? width) internal EmbedImage(string url, string proxyUrl, int? height, int? width)
{ {
Url = url; Url = url;
ProxyUrl = proxyUrl; ProxyUrl = proxyUrl;
Height = height; Height = height;
Width = width; Width = width;
} }
internal static EmbedImage Create(Model model)
{
return new EmbedImage(model.Url, model.ProxyUrl,
model.Height.IsSpecified ? model.Height.Value : (int?)null,
model.Width.IsSpecified ? model.Width.Value : (int?)null);
}
private string DebuggerDisplay => $"{Url} ({(Width != null && Height != null ? $"{Width}x{Height}" : "0x0")})"; private string DebuggerDisplay => $"{Url} ({(Width != null && Height != null ? $"{Width}x{Height}" : "0x0")})";
public override string ToString() => Url; public override string ToString() => Url;

View File

@@ -1,5 +1,4 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.EmbedProvider;
namespace Discord namespace Discord
{ {
@@ -9,15 +8,11 @@ namespace Discord
public string Name { get; } public string Name { get; }
public string Url { get; } public string Url { get; }
private EmbedProvider(string name, string url) internal EmbedProvider(string name, string url)
{ {
Name = name; Name = name;
Url = url; Url = url;
} }
internal static EmbedProvider Create(Model model)
{
return new EmbedProvider(model.Name, model.Url);
}
private string DebuggerDisplay => $"{Name} ({Url})"; private string DebuggerDisplay => $"{Name} ({Url})";
public override string ToString() => Name; public override string ToString() => Name;

View File

@@ -1,5 +1,4 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.EmbedThumbnail;
namespace Discord namespace Discord
{ {
@@ -11,19 +10,13 @@ namespace Discord
public int? Height { get; } public int? Height { get; }
public int? Width { get; } public int? Width { get; }
private EmbedThumbnail(string url, string proxyUrl, int? height, int? width) internal EmbedThumbnail(string url, string proxyUrl, int? height, int? width)
{ {
Url = url; Url = url;
ProxyUrl = proxyUrl; ProxyUrl = proxyUrl;
Height = height; Height = height;
Width = width; Width = width;
} }
internal static EmbedThumbnail Create(Model model)
{
return new EmbedThumbnail(model.Url, model.ProxyUrl,
model.Height.IsSpecified ? model.Height.Value : (int?)null,
model.Width.IsSpecified ? model.Width.Value : (int?)null);
}
private string DebuggerDisplay => $"{Url} ({(Width != null && Height != null ? $"{Width}x{Height}" : "0x0")})"; private string DebuggerDisplay => $"{Url} ({(Width != null && Height != null ? $"{Width}x{Height}" : "0x0")})";
public override string ToString() => Url; public override string ToString() => Url;

View File

@@ -1,5 +1,4 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.EmbedVideo;
namespace Discord namespace Discord
{ {
@@ -10,18 +9,12 @@ namespace Discord
public int? Height { get; } public int? Height { get; }
public int? Width { get; } public int? Width { get; }
private EmbedVideo(string url, int? height, int? width) internal EmbedVideo(string url, int? height, int? width)
{ {
Url = url; Url = url;
Height = height; Height = height;
Width = width; Width = width;
} }
internal static EmbedVideo Create(Model model)
{
return new EmbedVideo(model.Url,
model.Height.IsSpecified ? model.Height.Value : (int?)null,
model.Width.IsSpecified ? model.Width.Value : (int?)null);
}
private string DebuggerDisplay => $"{Url} ({(Width != null && Height != null ? $"{Width}x{Height}" : "0x0")})"; private string DebuggerDisplay => $"{Url} ({(Width != null && Height != null ? $"{Width}x{Height}" : "0x0")})";
public override string ToString() => Url; public override string ToString() => Url;

View File

@@ -1,28 +1,22 @@
using Discord.API; using System;
using System;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using Model = Discord.API.Emoji;
namespace Discord namespace Discord
{ {
[DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct Emoji public struct Emoji
{ {
public ulong Id { get; } public ulong? Id { get; }
public string Name { get; } public string Name { get; }
public string Url => CDN.GetEmojiUrl(Id); public string Url => Id != null ? CDN.GetEmojiUrl(Id.Value) : null;
internal Emoji(ulong id, string name) internal Emoji(ulong? id, string name)
{ {
Id = id; Id = id;
Name = name; Name = name;
} }
internal static Emoji Create(Model emoji)
{
return new Emoji(emoji.Id.GetValueOrDefault(), emoji.Name);
}
public static Emoji Parse(string text) public static Emoji Parse(string text)
{ {

View File

@@ -32,6 +32,6 @@
/// <summary> /// <summary>
/// The embed the message should display /// The embed the message should display
/// </summary> /// </summary>
public Optional<EmbedBuilder> Embed { get; set; } public Optional<Embed> Embed { get; set; }
} }
} }

View File

@@ -1,6 +1,4 @@
using Model = Discord.API.Overwrite; namespace Discord
namespace Discord
{ {
public struct Overwrite public struct Overwrite
{ {
@@ -18,8 +16,5 @@ namespace Discord
TargetType = targetType; TargetType = targetType;
Permissions = permissions; Permissions = permissions;
} }
public Overwrite(Model model)
: this(model.TargetId, model.TargetType, new OverwritePermissions(model.Allow, model.Deny)) { }
} }
} }

View File

@@ -1,5 +1,4 @@
using Discord.API.Rest; using System;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Discord namespace Discord

View File

@@ -1,5 +1,4 @@
using System.Diagnostics; using System.Diagnostics;
using Model = Discord.API.Game;
namespace Discord namespace Discord
{ {
@@ -18,12 +17,6 @@ namespace Discord
} }
private Game(string name) private Game(string name)
: this(name, null, StreamType.NotStreaming) { } : this(name, null, StreamType.NotStreaming) { }
internal static Game Create(Model model)
{
return new Game(model.Name,
model.StreamUrl.GetValueOrDefault(null),
model.StreamType.GetValueOrDefault(null) ?? StreamType.NotStreaming);
}
public override string ToString() => Name; public override string ToString() => Name;
private string DebuggerDisplay => StreamUrl != null ? $"{Name} ({StreamUrl})" : Name; private string DebuggerDisplay => StreamUrl != null ? $"{Name} ({StreamUrl})" : Name;

View File

@@ -1,5 +1,4 @@
using Discord.API.Rest; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Application internal class Application
{ {
[JsonProperty("description")] [JsonProperty("description")]
public string Description { get; set; } public string Description { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Attachment internal class Attachment
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Ban internal class Ban
{ {
[JsonProperty("user")] [JsonProperty("user")]
public User User { get; set; } public User User { get; set; }

View File

@@ -4,7 +4,7 @@ using System;
namespace Discord.API namespace Discord.API
{ {
public class Channel internal class Channel
{ {
//Shared //Shared
[JsonProperty("id")] [JsonProperty("id")]

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace Discord.API namespace Discord.API
{ {
public class Connection internal class Connection
{ {
[JsonProperty("id")] [JsonProperty("id")]
public string Id { get; set; } public string Id { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Embed internal class Embed
{ {
[JsonProperty("title")] [JsonProperty("title")]
public string Title { get; set; } public string Title { get; set; }

View File

@@ -2,7 +2,7 @@
namespace Discord.API namespace Discord.API
{ {
public class EmbedAuthor internal class EmbedAuthor
{ {
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }

View File

@@ -2,7 +2,7 @@
namespace Discord.API namespace Discord.API
{ {
public class EmbedField internal class EmbedField
{ {
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }

View File

@@ -2,7 +2,7 @@
namespace Discord.API namespace Discord.API
{ {
public class EmbedFooter internal class EmbedFooter
{ {
[JsonProperty("text")] [JsonProperty("text")]
public string Text { get; set; } public string Text { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class EmbedImage internal class EmbedImage
{ {
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } public string Url { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class EmbedProvider internal class EmbedProvider
{ {
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class EmbedThumbnail internal class EmbedThumbnail
{ {
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } public string Url { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class EmbedVideo internal class EmbedVideo
{ {
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } public string Url { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Emoji internal class Emoji
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong? Id { get; set; } public ulong? Id { get; set; }

View File

@@ -5,7 +5,7 @@ using System.Runtime.Serialization;
namespace Discord.API namespace Discord.API
{ {
public class Game internal class Game
{ {
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Guild internal class Guild
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class GuildEmbed internal class GuildEmbed
{ {
[JsonProperty("enabled")] [JsonProperty("enabled")]
public bool Enabled { get; set; } public bool Enabled { get; set; }

View File

@@ -4,7 +4,7 @@ using System;
namespace Discord.API namespace Discord.API
{ {
public class GuildMember internal class GuildMember
{ {
[JsonProperty("user")] [JsonProperty("user")]
public User User { get; set; } public User User { get; set; }

View File

@@ -4,7 +4,7 @@ using System;
namespace Discord.API namespace Discord.API
{ {
public class Integration internal class Integration
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class IntegrationAccount internal class IntegrationAccount
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Invite internal class Invite
{ {
[JsonProperty("code")] [JsonProperty("code")]
public string Code { get; set; } public string Code { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class InviteChannel internal class InviteChannel
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class InviteGuild internal class InviteGuild
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -4,7 +4,7 @@ using System;
namespace Discord.API namespace Discord.API
{ {
public class InviteMetadata : Invite internal class InviteMetadata : Invite
{ {
[JsonProperty("inviter")] [JsonProperty("inviter")]
public User Inviter { get; set; } public User Inviter { get; set; }

View File

@@ -4,7 +4,7 @@ using System;
namespace Discord.API namespace Discord.API
{ {
public class Message internal class Message
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Overwrite internal class Overwrite
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong TargetId { get; set; } public ulong TargetId { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Presence internal class Presence
{ {
[JsonProperty("user")] [JsonProperty("user")]
public User User { get; set; } public User User { get; set; }

View File

@@ -1,12 +1,8 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Reaction internal class Reaction
{ {
[JsonProperty("count")] [JsonProperty("count")]
public int Count { get; set; } public int Count { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class ReadState internal class ReadState
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Relationship internal class Relationship
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -1,7 +1,7 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
namespace Discord.API namespace Discord.API
{ {
public enum RelationshipType internal enum RelationshipType
{ {
Friend = 1, Friend = 1,
Blocked = 2, Blocked = 2,

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class Role internal class Role
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class User internal class User
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class UserGuild internal class UserGuild
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class VoiceRegion internal class VoiceRegion
{ {
[JsonProperty("id")] [JsonProperty("id")]
public string Id { get; set; } public string Id { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API namespace Discord.API
{ {
public class VoiceState internal class VoiceState
{ {
[JsonProperty("guild_id")] [JsonProperty("guild_id")]
public ulong? GuildId { get; set; } public ulong? GuildId { get; set; }

View File

@@ -1,6 +1,6 @@
namespace Discord.API namespace Discord.API
{ {
public struct EntityOrId<T> internal struct EntityOrId<T>
{ {
public ulong Id { get; } public ulong Id { get; }
public T Object { get; } public T Object { get; }

View File

@@ -2,7 +2,7 @@
namespace Discord.API namespace Discord.API
{ {
public struct Image internal struct Image
{ {
public Stream Stream { get; } public Stream Stream { get; }
public string Hash { get; } public string Hash { get; }

View File

@@ -4,5 +4,5 @@ using System;
namespace Discord.API namespace Discord.API
{ {
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
public class Int53Attribute : Attribute { } internal class Int53Attribute : Attribute { }
} }

View File

@@ -2,7 +2,7 @@
namespace Discord.Net.Rest namespace Discord.Net.Rest
{ {
struct MultipartFile internal struct MultipartFile
{ {
public Stream Stream { get; } public Stream Stream { get; }
public string Filename { get; } public string Filename { get; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class CreateChannelInviteParams internal class CreateChannelInviteParams
{ {
[JsonProperty("max_age")] [JsonProperty("max_age")]
public Optional<int> MaxAge { get; set; } public Optional<int> MaxAge { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class CreateDMChannelParams internal class CreateDMChannelParams
{ {
[JsonProperty("recipient_id")] [JsonProperty("recipient_id")]
public ulong RecipientId { get; } public ulong RecipientId { get; }

View File

@@ -1,7 +1,7 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class CreateGuildBanParams internal class CreateGuildBanParams
{ {
public Optional<int> DeleteMessageDays { get; set; } public Optional<int> DeleteMessageDays { get; set; }
} }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class CreateGuildChannelParams internal class CreateGuildChannelParams
{ {
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; } public string Name { get; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class CreateGuildIntegrationParams internal class CreateGuildIntegrationParams
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; } public ulong Id { get; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class CreateGuildParams internal class CreateGuildParams
{ {
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; } public string Name { get; }

View File

@@ -1,11 +1,10 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
using System;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class CreateMessageParams internal class CreateMessageParams
{ {
[JsonProperty("content")] [JsonProperty("content")]
public string Content { get; } public string Content { get; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class DeleteMessagesParams internal class DeleteMessagesParams
{ {
[JsonProperty("messages")] [JsonProperty("messages")]
public ulong[] MessageIds { get; } public ulong[] MessageIds { get; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class GetBotGatewayResponse internal class GetBotGatewayResponse
{ {
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } public string Url { get; set; }

View File

@@ -1,7 +1,7 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class GetChannelMessagesParams internal class GetChannelMessagesParams
{ {
public Optional<int> Limit { get; set; } public Optional<int> Limit { get; set; }
public Optional<Direction> RelativeDirection { get; set; } public Optional<Direction> RelativeDirection { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class GetGatewayResponse internal class GetGatewayResponse
{ {
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } public string Url { get; set; }

View File

@@ -1,7 +1,7 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class GetGuildMembersParams internal class GetGuildMembersParams
{ {
public Optional<int> Limit { get; set; } public Optional<int> Limit { get; set; }
public Optional<ulong> AfterUserId { get; set; } public Optional<ulong> AfterUserId { get; set; }

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class GetGuildPruneCountResponse internal class GetGuildPruneCountResponse
{ {
[JsonProperty("pruned")] [JsonProperty("pruned")]
public int Pruned { get; set; } public int Pruned { get; set; }

View File

@@ -1,6 +1,6 @@
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
public class GetReactionUsersParams internal class GetReactionUsersParams
{ {
public Optional<int> Limit { get; set; } public Optional<int> Limit { get; set; }
public Optional<ulong> AfterUserId { get; set; } public Optional<ulong> AfterUserId { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class GuildPruneParams internal class GuildPruneParams
{ {
[JsonProperty("days")] [JsonProperty("days")]
public int Days { get; } public int Days { get; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyChannelPermissionsParams internal class ModifyChannelPermissionsParams
{ {
[JsonProperty("type")] [JsonProperty("type")]
public string Type { get; } public string Type { get; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyCurrentUserNickParams internal class ModifyCurrentUserNickParams
{ {
[JsonProperty("nick")] [JsonProperty("nick")]
public string Nickname { get; } public string Nickname { get; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyCurrentUserParams internal class ModifyCurrentUserParams
{ {
[JsonProperty("username")] [JsonProperty("username")]
public Optional<string> Username { get; set; } public Optional<string> Username { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyGuildChannelParams internal class ModifyGuildChannelParams
{ {
[JsonProperty("name")] [JsonProperty("name")]
public Optional<string> Name { get; set; } public Optional<string> Name { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyGuildChannelsParams internal class ModifyGuildChannelsParams
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyGuildEmbedParams internal class ModifyGuildEmbedParams
{ {
[JsonProperty("enabled")] [JsonProperty("enabled")]
public Optional<bool> Enabled { get; set; } public Optional<bool> Enabled { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyGuildIntegrationParams internal class ModifyGuildIntegrationParams
{ {
[JsonProperty("expire_behavior")] [JsonProperty("expire_behavior")]
public Optional<int> ExpireBehavior { get; set; } public Optional<int> ExpireBehavior { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyGuildMemberParams internal class ModifyGuildMemberParams
{ {
[JsonProperty("mute")] [JsonProperty("mute")]
public Optional<bool> Mute { get; set; } public Optional<bool> Mute { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyGuildParams internal class ModifyGuildParams
{ {
[JsonProperty("username")] [JsonProperty("username")]
public Optional<string> Username { get; set; } public Optional<string> Username { get; set; }

View File

@@ -4,7 +4,7 @@ using Newtonsoft.Json;
namespace Discord.API.Rest namespace Discord.API.Rest
{ {
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class ModifyGuildRoleParams internal class ModifyGuildRoleParams
{ {
[JsonProperty("name")] [JsonProperty("name")]
public Optional<string> Name { get; set; } public Optional<string> Name { get; set; }

Some files were not shown because too many files have changed in this diff Show More