Feature: CustomStatusGame Activity (#1406)

* Implement CustomStatusGame activity

Adds the CustomStatusGame class, which is the activity corresponding to the custom status feature.

* Remove unused import from Game.cs
This commit is contained in:
Chris Johnston
2019-11-09 10:41:10 -08:00
committed by Christopher F
parent 5439cbad5a
commit 79a0ea9de3
5 changed files with 73 additions and 1 deletions

View File

@@ -35,6 +35,12 @@ namespace Discord.API
public Optional<string> SessionId { get; set; }
[JsonProperty("Flags")]
public Optional<ActivityProperties> Flags { get; set; }
[JsonProperty("id")]
public Optional<string> Id { get; set; }
[JsonProperty("emoji")]
public Optional<Emoji> Emoji { get; set; }
[JsonProperty("created_at")]
public Optional<long> CreatedAt { get; set; }
[OnError]
internal void OnError(StreamingContext context, ErrorContext errorContext)

View File

@@ -5,6 +5,13 @@ namespace Discord.Rest
{
internal static class EntityExtensions
{
public static IEmote ToIEmote(this API.Emoji model)
{
if (model.Id.HasValue)
return model.ToEntity();
return new Emoji(model.Name);
}
public static GuildEmote ToEntity(this API.Emoji model)
=> new GuildEmote(model.Id.Value,
model.Name,