|
|
@@ -1,10 +1,13 @@ |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
|
|
|
|
using Model = Discord.API.AuditLog; |
|
|
|
using EntryModel = Discord.API.AuditLogEntry; |
|
|
|
|
|
|
|
namespace Discord.Rest |
|
|
|
{ |
|
|
|
/// <summary> |
|
|
|
/// Represents a piece of audit log data related to an invite creation. |
|
|
|
/// </summary> |
|
|
|
public class InviteCreateAuditLogData : IAuditLogData |
|
|
|
{ |
|
|
|
private InviteCreateAuditLogData(int maxAge, string code, bool temporary, IUser inviter, ulong channelId, int uses, int maxUses) |
|
|
@@ -44,12 +47,57 @@ namespace Discord.Rest |
|
|
|
return new InviteCreateAuditLogData(maxAge, code, temporary, inviter, channelId, uses, maxUses); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Gets the time (in seconds) until the invite expires. |
|
|
|
/// </summary> |
|
|
|
/// <returns> |
|
|
|
/// An <see cref="int"/> representing the time in seconds until this invite expires. |
|
|
|
/// </returns> |
|
|
|
public int MaxAge { get; } |
|
|
|
/// <summary> |
|
|
|
/// Gets the unique identifier for this invite. |
|
|
|
/// </summary> |
|
|
|
/// <returns> |
|
|
|
/// A string containing the invite code (e.g. <c>FTqNnyS</c>). |
|
|
|
/// </returns> |
|
|
|
public string Code { get; } |
|
|
|
/// <summary> |
|
|
|
/// Determines whether the invite is a temporary one (i.e. whether the invite will be removed from the guild |
|
|
|
/// when the user logs off). |
|
|
|
/// </summary> |
|
|
|
/// <returns> |
|
|
|
/// <c>true</c> if users accepting this invite will be removed from the guild when they log off; otherwise |
|
|
|
/// <c>false</c>. |
|
|
|
/// </returns> |
|
|
|
public bool Temporary { get; } |
|
|
|
/// <summary> |
|
|
|
/// Gets the user that created this invite. |
|
|
|
/// </summary> |
|
|
|
/// <returns> |
|
|
|
/// A generic <see cref="IUser"/> that created this invite. |
|
|
|
/// </returns> |
|
|
|
public IUser Creator { get; } |
|
|
|
/// <summary> |
|
|
|
/// Gets the ID of the channel this invite is linked to. |
|
|
|
/// </summary> |
|
|
|
/// <returns> |
|
|
|
/// An <see cref="ulong"/> representing the channel snowflake identifier that the invite points to. |
|
|
|
/// </returns> |
|
|
|
public ulong ChannelId { get; } |
|
|
|
/// <summary> |
|
|
|
/// Gets the number of times this invite has been used. |
|
|
|
/// </summary> |
|
|
|
/// <returns> |
|
|
|
/// An <see cref="int"/> representing the number of times this invite has been used. |
|
|
|
/// </returns> |
|
|
|
public int Uses { get; } |
|
|
|
/// <summary> |
|
|
|
/// Gets the max number of uses this invite may have. |
|
|
|
/// </summary> |
|
|
|
/// <returns> |
|
|
|
/// An <see cref="int"/> representing the number of uses this invite may be accepted until it is removed |
|
|
|
/// from the guild; <c>null</c> if none is set. |
|
|
|
/// </returns> |
|
|
|
public int MaxUses { get; } |
|
|
|
} |
|
|
|
} |