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:
committed by
Christopher F
parent
5439cbad5a
commit
79a0ea9de3
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user