Added path property to all models for logging
This commit is contained in:
@@ -64,6 +64,8 @@ namespace Discord
|
|||||||
/// <summary> Gets the type of this channel). </summary>
|
/// <summary> Gets the type of this channel). </summary>
|
||||||
public ChannelType Type { get; private set; }
|
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>
|
/// <summary> Gets true if this is a private chat with another user. </summary>
|
||||||
public bool IsPrivate => Recipient != null;
|
public bool IsPrivate => Recipient != null;
|
||||||
/// <summary> Gets the string used to mention this channel. </summary>
|
/// <summary> Gets the string used to mention this channel. </summary>
|
||||||
@@ -345,7 +347,7 @@ namespace Discord
|
|||||||
public async Task<Message> SendFile(string filePath)
|
public async Task<Message> SendFile(string filePath)
|
||||||
{
|
{
|
||||||
using (var stream = File.OpenRead(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)
|
public async Task<Message> SendFile(string filename, Stream stream)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -85,8 +85,10 @@ namespace Discord
|
|||||||
/// <summary> Gets when this invite was created. </summary>
|
/// <summary> Gets when this invite was created. </summary>
|
||||||
public DateTime CreatedAt { get; private set; }
|
public DateTime CreatedAt { get; private set; }
|
||||||
|
|
||||||
/// <summary> Returns a URL for this invite using XkcdCode if available or Id if not. </summary>
|
/// <summary> Gets the path to this object. </summary>
|
||||||
public string Url => $"{DiscordConfig.InviteUrl}/{Code}";
|
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)
|
internal Invite(DiscordClient client, string code, string xkcdPass)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -201,6 +201,8 @@ namespace Discord
|
|||||||
|
|
||||||
internal int Nonce { get; set; }
|
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>
|
/// <summary> Returns the server containing the channel this message was sent to. </summary>
|
||||||
public Server Server => Channel.Server;
|
public Server Server => Channel.Server;
|
||||||
/// <summary> Returns if this message was sent from the logged-in accounts. </summary>
|
/// <summary> Returns if this message was sent from the logged-in accounts. </summary>
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ namespace Discord
|
|||||||
/// <summary> Gets the color of this role. </summary>
|
/// <summary> Gets the color of this role. </summary>
|
||||||
public Color Color { get; private set; }
|
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>
|
/// <summary> Gets true if this is the role representing all users in a server. </summary>
|
||||||
public bool IsEveryone => Id == Server.Id;
|
public bool IsEveryone => Id == Server.Id;
|
||||||
/// <summary> Gets a list of all members in this role. </summary>
|
/// <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>
|
/// <summary> Gets all custom emojis on this server. </summary>
|
||||||
public IEnumerable<Emoji> CustomEmojis { get; private set; }
|
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>
|
/// <summary> Gets the user that created this server. </summary>
|
||||||
public User Owner => GetUser(_ownerId);
|
public User Owner => GetUser(_ownerId);
|
||||||
/// <summary> Returns true if the current user owns this server. </summary>
|
/// <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>
|
// /// <summary> Gets this user's voice token. </summary>
|
||||||
// public string Token { get; private set; }
|
// 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>
|
/// <summary> Gets the current private channel for this user if one exists. </summary>
|
||||||
public Channel PrivateChannel => Client.GetPrivateChannel(Id);
|
public Channel PrivateChannel => Client.GetPrivateChannel(Id);
|
||||||
/// <summary> Returns the string used to mention this user. </summary>
|
/// <summary> Returns the string used to mention this user. </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user