using System.Diagnostics;
using Model = Discord.API.Ban;
namespace Discord.Rest
{
///
/// Represents a REST-based ban object.
///
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class RestBan : IBan
{
///
/// Gets the banned user.
///
///
/// A generic object that was banned.
///
public RestUser User { get; }
///
public string Reason { get; }
internal RestBan(RestUser user, string reason)
{
User = user;
Reason = reason;
}
internal static RestBan Create(BaseDiscordClient client, Model model)
{
return new RestBan(RestUser.Create(client, model.User), model.Reason);
}
///
/// Gets the name of the banned user.
///
///
/// A string containing the name of the user that was banned.
///
public override string ToString() => User.ToString();
private string DebuggerDisplay => $"{User}: {Reason}";
//IBan
///
IUser IBan.User => User;
}
}