@@ -16,19 +16,19 @@ namespace Discord.API | |||||
public ButtonStyle Style { get; set; } | public ButtonStyle Style { get; set; } | ||||
[JsonProperty("label")] | [JsonProperty("label")] | ||||
public string Label { get; set; } | |||||
public Optional<string> Label { get; set; } | |||||
[JsonProperty("emoji")] | [JsonProperty("emoji")] | ||||
public Emoji Emote { get; set; } | |||||
public Optional<Emoji> Emote { get; set; } | |||||
[JsonProperty("custom_id")] | [JsonProperty("custom_id")] | ||||
public string CustomId { get; set; } | |||||
public Optional<string> CustomId { get; set; } | |||||
[JsonProperty("url")] | [JsonProperty("url")] | ||||
public string Url { get; set; } | |||||
public Optional<string> Url { get; set; } | |||||
[JsonProperty("disabled")] | [JsonProperty("disabled")] | ||||
public bool Disabled { get; set; } | |||||
public Optional<bool> Disabled { get; set; } | |||||
public ButtonComponent() { } | public ButtonComponent() { } | ||||
@@ -9,7 +9,7 @@ | |||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0;netstandard2.1</TargetFrameworks> | <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0;netstandard2.1</TargetFrameworks> | ||||
<PackageIcon>Temporary.png</PackageIcon> | <PackageIcon>Temporary.png</PackageIcon> | ||||
<PackageProjectUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</PackageProjectUrl> | <PackageProjectUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</PackageProjectUrl> | ||||
<Version>2.3.3</Version> | |||||
<Version>2.3.4</Version> | |||||
<PackageId>Discord.Net.Labs.Rest</PackageId> | <PackageId>Discord.Net.Labs.Rest</PackageId> | ||||
<RepositoryUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</RepositoryUrl> | <RepositoryUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</RepositoryUrl> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
@@ -132,11 +132,11 @@ namespace Discord.Rest | |||||
Components = model.Components.Value.Select(x => new ActionRowComponent(x.Components.Select(x => | Components = model.Components.Value.Select(x => new ActionRowComponent(x.Components.Select(x => | ||||
new ButtonComponent( | new ButtonComponent( | ||||
x.Style, | x.Style, | ||||
x.Label, | |||||
x.Emote.Id.HasValue ? new Emote(x.Emote.Id.Value, x.Emote.Name, x.Emote.Animated.GetValueOrDefault()) : new Emoji(x.Emote.Name), | |||||
x.CustomId, | |||||
x.Url, | |||||
x.Disabled) | |||||
x.Label.GetValueOrDefault(), | |||||
x.Emote.IsSpecified ? x.Emote.Value.Id.HasValue ? new Emote(x.Emote.Value.Id.Value, x.Emote.Value.Name, x.Emote.Value.Animated.GetValueOrDefault()) : new Emoji(x.Emote.Value.Name) : null, | |||||
x.CustomId.GetValueOrDefault(), | |||||
x.Url.GetValueOrDefault(), | |||||
x.Disabled.GetValueOrDefault()) | |||||
).ToList() | ).ToList() | ||||
)).ToList(); | )).ToList(); | ||||
} | } | ||||
@@ -163,13 +163,13 @@ namespace Discord.WebSocket | |||||
if (model.Components.IsSpecified) | if (model.Components.IsSpecified) | ||||
{ | { | ||||
Components = model.Components.Value.Select(x => new ActionRowComponent(x.Components.Select(x => | Components = model.Components.Value.Select(x => new ActionRowComponent(x.Components.Select(x => | ||||
new ButtonComponent( | |||||
new ButtonComponent( | |||||
x.Style, | x.Style, | ||||
x.Label, | |||||
x.Emote.Id.HasValue ? new Emote(x.Emote.Id.Value, x.Emote.Name, x.Emote.Animated.GetValueOrDefault()) : new Emoji(x.Emote.Name), | |||||
x.CustomId, | |||||
x.Url, | |||||
x.Disabled) | |||||
x.Label.GetValueOrDefault(), | |||||
x.Emote.IsSpecified ? x.Emote.Value.Id.HasValue ? new Emote(x.Emote.Value.Id.Value, x.Emote.Value.Name, x.Emote.Value.Animated.GetValueOrDefault()) : new Emoji(x.Emote.Value.Name) : null, | |||||
x.CustomId.GetValueOrDefault(), | |||||
x.Url.GetValueOrDefault(), | |||||
x.Disabled.GetValueOrDefault()) | |||||
).ToList() | ).ToList() | ||||
)).ToList(); | )).ToList(); | ||||
} | } | ||||
@@ -2,7 +2,7 @@ | |||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||||
<metadata> | <metadata> | ||||
<id>Discord.Net.Labs</id> | <id>Discord.Net.Labs</id> | ||||
<version>2.3.1$suffix$</version> | |||||
<version>2.3.2$suffix$</version> | |||||
<title>Discord.Net Labs</title> | <title>Discord.Net Labs</title> | ||||
<authors>Discord.Net Contributors</authors> | <authors>Discord.Net Contributors</authors> | ||||
<owners>quinchs</owners> | <owners>quinchs</owners> | ||||
@@ -14,23 +14,23 @@ | |||||
<iconUrl>https://avatars.githubusercontent.com/u/84047264</iconUrl> | <iconUrl>https://avatars.githubusercontent.com/u/84047264</iconUrl> | ||||
<dependencies> | <dependencies> | ||||
<group targetFramework="net461"> | <group targetFramework="net461"> | ||||
<dependency id="Discord.Net.Labs.Core" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Rest" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.WebSocket" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Core" version="2.3.4$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Rest" version="2.3.4$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.WebSocket" version="2.3.3$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Commands" version="2.3.1$suffix$" /> | <dependency id="Discord.Net.Labs.Commands" version="2.3.1$suffix$" /> | ||||
<dependency id="Discord.Net.Labs.Webhook" version="2.3.1$suffix$" /> | <dependency id="Discord.Net.Labs.Webhook" version="2.3.1$suffix$" /> | ||||
</group> | </group> | ||||
<group targetFramework="netstandard2.0"> | <group targetFramework="netstandard2.0"> | ||||
<dependency id="Discord.Net.Labs.Core" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Rest" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.WebSocket" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Core" version="2.3.4$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Rest" version="2.3.4$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.WebSocket" version="2.3.3$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Commands" version="2.3.1$suffix$" /> | <dependency id="Discord.Net.Labs.Commands" version="2.3.1$suffix$" /> | ||||
<dependency id="Discord.Net.Labs.Webhook" version="2.3.1$suffix$" /> | <dependency id="Discord.Net.Labs.Webhook" version="2.3.1$suffix$" /> | ||||
</group> | </group> | ||||
<group targetFramework="netstandard2.1"> | <group targetFramework="netstandard2.1"> | ||||
<dependency id="Discord.Net.Labs.Core" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Rest" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.WebSocket" version="2.3.1$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Core" version="2.3.4$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Rest" version="2.3.4$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.WebSocket" version="2.3.3$suffix$" /> | |||||
<dependency id="Discord.Net.Labs.Commands" version="2.3.1$suffix$" /> | <dependency id="Discord.Net.Labs.Commands" version="2.3.1$suffix$" /> | ||||
<dependency id="Discord.Net.Labs.Webhook" version="2.3.1$suffix$" /> | <dependency id="Discord.Net.Labs.Webhook" version="2.3.1$suffix$" /> | ||||
</group> | </group> | ||||