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
@@ -20,6 +20,10 @@ namespace Discord
|
||||
/// <summary>
|
||||
/// The user is watching some form of media.
|
||||
/// </summary>
|
||||
Watching = 3
|
||||
Watching = 3,
|
||||
/// <summary>
|
||||
/// The user has set a custom status.
|
||||
/// </summary>
|
||||
CustomStatus = 4,
|
||||
}
|
||||
}
|
||||
|
||||
40
src/Discord.Net.Core/Entities/Activities/CustomStatusGame.cs
Normal file
40
src/Discord.Net.Core/Entities/Activities/CustomStatusGame.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Discord
|
||||
{
|
||||
/// <summary>
|
||||
/// A user's activity for their custom status.
|
||||
/// </summary>
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
public class CustomStatusGame : Game
|
||||
{
|
||||
internal CustomStatusGame() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the emote, if it is set.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An <see cref="IEmote"/> containing the <see cref="Emoji"/> or <see cref="GuildEmote"/> set by the user.
|
||||
/// </returns>
|
||||
public IEmote Emote { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the timestamp of when this status was created.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="DateTimeOffset"/> containing the time when this status was created.
|
||||
/// </returns>
|
||||
public DateTimeOffset CreatedAt { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the state of the status.
|
||||
/// </summary>
|
||||
public string State { get; internal set; }
|
||||
|
||||
public override string ToString()
|
||||
=> $"{Emote} {State}";
|
||||
|
||||
private string DebuggerDisplay => $"{Name}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user