using System.Diagnostics;
using Model = Discord.API.Presence;
namespace Discord.WebSocket
{
///
/// Represents the WebSocket user's presence status. This may include their online status and their activity.
///
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct SocketPresence : IPresence
{
///
public UserStatus Status { get; }
///
public IActivity Activity { get; }
internal SocketPresence(UserStatus status, IActivity activity)
{
Status = status;
Activity= activity;
}
internal static SocketPresence Create(Model model)
{
return new SocketPresence(model.Status, model.Game?.ToEntity());
}
///
/// Gets the status of the user.
///
///
/// A string that resolves to .
///
public override string ToString() => Status.ToString();
private string DebuggerDisplay => $"{Status}{(Activity != null ? $", {Activity.Name}": "")}";
internal SocketPresence Clone() => this;
}
}