Added path property to all models for logging
This commit is contained in:
@@ -41,11 +41,11 @@ namespace Discord
|
||||
Permissions = new ChannelPermissionOverrides(allow, deny);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private readonly ConcurrentDictionary<ulong, Member> _users;
|
||||
private readonly ConcurrentDictionary<ulong, Message> _messages;
|
||||
private Dictionary<ulong, PermissionOverwrite> _permissionOverwrites;
|
||||
|
||||
|
||||
public DiscordClient Client { get; }
|
||||
|
||||
/// <summary> Gets the unique identifier for this channel. </summary>
|
||||
@@ -64,6 +64,8 @@ namespace Discord
|
||||
/// <summary> Gets the type of this channel). </summary>
|
||||
public ChannelType Type { get; private set; }
|
||||
|
||||
/// <summary> Gets the path to this object. </summary>
|
||||
internal string Path => $"{Server?.Name ?? "[Private]"}/{Name}";
|
||||
/// <summary> Gets true if this is a private chat with another user. </summary>
|
||||
public bool IsPrivate => Recipient != null;
|
||||
/// <summary> Gets the string used to mention this channel. </summary>
|
||||
@@ -345,7 +347,7 @@ namespace Discord
|
||||
public async Task<Message> SendFile(string filePath)
|
||||
{
|
||||
using (var stream = File.OpenRead(filePath))
|
||||
return await SendFile(Path.GetFileName(filePath), stream).ConfigureAwait(false);
|
||||
return await SendFile(System.IO.Path.GetFileName(filePath), stream).ConfigureAwait(false);
|
||||
}
|
||||
public async Task<Message> SendFile(string filename, Stream stream)
|
||||
{
|
||||
|
||||
@@ -85,8 +85,10 @@ namespace Discord
|
||||
/// <summary> Gets when this invite was created. </summary>
|
||||
public DateTime CreatedAt { get; private set; }
|
||||
|
||||
/// <summary> Returns a URL for this invite using XkcdCode if available or Id if not. </summary>
|
||||
public string Url => $"{DiscordConfig.InviteUrl}/{Code}";
|
||||
/// <summary> Gets the path to this object. </summary>
|
||||
internal string Path => $"{Server?.Name ?? "[Private]"}/{Code}";
|
||||
/// <summary> Returns a URL for this invite using XkcdCode if available or Id if not. </summary>
|
||||
public string Url => $"{DiscordConfig.InviteUrl}/{Code}";
|
||||
|
||||
internal Invite(DiscordClient client, string code, string xkcdPass)
|
||||
{
|
||||
|
||||
@@ -201,6 +201,8 @@ namespace Discord
|
||||
|
||||
internal int Nonce { get; set; }
|
||||
|
||||
/// <summary> Gets the path to this object. </summary>
|
||||
internal string Path => $"{Server?.Name ?? "[Private]"}/{Id}";
|
||||
/// <summary> Returns the server containing the channel this message was sent to. </summary>
|
||||
public Server Server => Channel.Server;
|
||||
/// <summary> Returns if this message was sent from the logged-in accounts. </summary>
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Discord
|
||||
public UserStatus Status => Client.PrivateUser.Status;
|
||||
/// <summary> Returns the string used to mention this user. </summary>
|
||||
public string Mention => $"<@{Id}>";
|
||||
|
||||
|
||||
/// <summary> Gets the email for this user. </summary>
|
||||
public string Email { get; private set; }
|
||||
/// <summary> Gets if the email for this user has been verified. </summary>
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace Discord
|
||||
/// <summary> Gets the color of this role. </summary>
|
||||
public Color Color { get; private set; }
|
||||
|
||||
/// <summary> Gets the path to this object. </summary>
|
||||
internal string Path => $"{Server?.Name ?? "[Private]"}/{Name}";
|
||||
/// <summary> Gets true if this is the role representing all users in a server. </summary>
|
||||
public bool IsEveryone => Id == Server.Id;
|
||||
/// <summary> Gets a list of all members in this role. </summary>
|
||||
|
||||
@@ -79,6 +79,8 @@ namespace Discord
|
||||
/// <summary> Gets all custom emojis on this server. </summary>
|
||||
public IEnumerable<Emoji> CustomEmojis { get; private set; }
|
||||
|
||||
/// <summary> Gets the path to this object. </summary>
|
||||
internal string Path => Name;
|
||||
/// <summary> Gets the user that created this server. </summary>
|
||||
public User Owner => GetUser(_ownerId);
|
||||
/// <summary> Returns true if the current user owns this server. </summary>
|
||||
|
||||
@@ -73,6 +73,8 @@ namespace Discord
|
||||
// /// <summary> Gets this user's voice token. </summary>
|
||||
// public string Token { get; private set; }
|
||||
|
||||
/// <summary> Gets the path to this object. </summary>
|
||||
internal string Path => $"{Server?.Name ?? "[Private]"}/{Name}";
|
||||
/// <summary> Gets the current private channel for this user if one exists. </summary>
|
||||
public Channel PrivateChannel => Client.GetPrivateChannel(Id);
|
||||
/// <summary> Returns the string used to mention this user. </summary>
|
||||
|
||||
Reference in New Issue
Block a user