@@ -1,7 +1,7 @@ | |||||
namespace Discord | namespace Discord | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an entry in an audit log. | |||||
/// Represents a generic audit log entry. | |||||
/// </summary> | /// </summary> | ||||
public interface IAuditLogEntry : IEntity<ulong> | public interface IAuditLogEntry : IEntity<ulong> | ||||
{ | { | ||||
@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an audit log data for a ban action. | |||||
/// Represents a piece of audit log data related to a ban. | |||||
/// </summary> | /// </summary> | ||||
public class BanAuditLogData : IAuditLogData | public class BanAuditLogData : IAuditLogData | ||||
{ | { | ||||
@@ -24,6 +24,9 @@ namespace Discord.Rest | |||||
/// <summary> | /// <summary> | ||||
/// Gets the user that was banned. | /// Gets the user that was banned. | ||||
/// </summary> | /// </summary> | ||||
/// <returns> | |||||
/// A generic <see cref="IUser"/> object representing the banned user. | |||||
/// </returns> | |||||
public IUser Target { get; } | public IUser Target { get; } | ||||
} | } | ||||
} | } |
@@ -7,7 +7,7 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an audit log data for a channel creation. | |||||
/// Represents a piece of audit log data related to a channel creation. | |||||
/// </summary> | /// </summary> | ||||
public class ChannelCreateAuditLogData : IAuditLogData | public class ChannelCreateAuditLogData : IAuditLogData | ||||
{ | { | ||||
@@ -7,7 +7,7 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an audit log data for a channel deletion. | |||||
/// Represents a piece of audit log data related to a channel deletion. | |||||
/// </summary> | /// </summary> | ||||
public class ChannelDeleteAuditLogData : IAuditLogData | public class ChannelDeleteAuditLogData : IAuditLogData | ||||
{ | { | ||||
@@ -1,7 +1,7 @@ | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents information for a channel. | |||||
/// Represents information for a channel. | |||||
/// </summary> | /// </summary> | ||||
public struct ChannelInfo | public struct ChannelInfo | ||||
{ | { | ||||
@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an audit log data for a channel update. | |||||
/// Represents a piece of audit log data related to a channel update. | |||||
/// </summary> | /// </summary> | ||||
public class ChannelUpdateAuditLogData : IAuditLogData | public class ChannelUpdateAuditLogData : IAuditLogData | ||||
{ | { | ||||
@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an audit log data for an emoji creation. | |||||
/// Represents a piece of audit log data related to an emoji creation. | |||||
/// </summary> | /// </summary> | ||||
public class EmoteCreateAuditLogData : IAuditLogData | public class EmoteCreateAuditLogData : IAuditLogData | ||||
{ | { | ||||
@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an audit log data for an emoji deletion. | |||||
/// Represents a piece of audit log data related to an emoji deletion. | |||||
/// </summary> | /// </summary> | ||||
public class EmoteDeleteAuditLogData : IAuditLogData | public class EmoteDeleteAuditLogData : IAuditLogData | ||||
{ | { | ||||
@@ -6,7 +6,7 @@ using EntryModel = Discord.API.AuditLogEntry; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Represents an audit log data for an emoji update. | |||||
/// Represents a piece of audit log data related to an emoji update. | |||||
/// </summary> | /// </summary> | ||||
public class EmoteUpdateAuditLogData : IAuditLogData | public class EmoteUpdateAuditLogData : IAuditLogData | ||||
{ | { | ||||
@@ -57,7 +57,7 @@ namespace Discord.Rest | |||||
/// Gets the ID of this guild's icon. | /// Gets the ID of this guild's icon. | ||||
/// </summary> | /// </summary> | ||||
/// <returns> | /// <returns> | ||||
/// An identifier for the splash image; <c>null</c> if none is set. | |||||
/// A string containing the identifier for the splash image; <c>null</c> if none is set. | |||||
/// </returns> | /// </returns> | ||||
public string IconHash { get; } | public string IconHash { get; } | ||||
/// <summary> | /// <summary> | ||||
@@ -71,7 +71,7 @@ namespace Discord.Rest | |||||
/// Gets the owner of this guild. | /// Gets the owner of this guild. | ||||
/// </summary> | /// </summary> | ||||
/// <returns> | /// <returns> | ||||
/// An <see cref="IUser"/> object representing the owner of this guild. | |||||
/// A generic <see cref="IUser"/> object representing the owner of this guild. | |||||
/// </returns> | /// </returns> | ||||
public IUser Owner { get; } | public IUser Owner { get; } | ||||
/// <summary> | /// <summary> | ||||
@@ -1,10 +1,13 @@ | |||||
using System.Linq; | |||||
using System.Linq; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Represents a piece of audit log data related to a guild update. | |||||
/// </summary> | |||||
public class GuildUpdateAuditLogData : IAuditLogData | public class GuildUpdateAuditLogData : IAuditLogData | ||||
{ | { | ||||
private GuildUpdateAuditLogData(GuildInfo before, GuildInfo after) | private GuildUpdateAuditLogData(GuildInfo before, GuildInfo after) | ||||
@@ -73,7 +76,19 @@ namespace Discord.Rest | |||||
return new GuildUpdateAuditLogData(before, after); | return new GuildUpdateAuditLogData(before, after); | ||||
} | } | ||||
/// <summary> | |||||
/// Gets the guild information before the changes. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// An information object containing the original guild information before the changes were made. | |||||
/// </returns> | |||||
public GuildInfo Before { get; } | public GuildInfo Before { get; } | ||||
/// <summary> | |||||
/// Gets the guild information after the changes. | |||||
/// </summary> | |||||
/// <returns> | |||||
/// An information object containing the guild information after the changes were made. | |||||
/// </returns> | |||||
public GuildInfo After { get; } | public GuildInfo After { get; } | ||||
} | } | ||||
} | } |
@@ -1,10 +1,13 @@ | |||||
using System.Linq; | |||||
using System.Linq; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Represents a piece of audit log data related to an invite creation. | |||||
/// </summary> | |||||
public class InviteCreateAuditLogData : IAuditLogData | public class InviteCreateAuditLogData : IAuditLogData | ||||
{ | { | ||||
private InviteCreateAuditLogData(int maxAge, string code, bool temporary, IUser inviter, ulong channelId, int uses, int maxUses) | 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); | 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; } | 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; } | 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; } | 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; } | 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; } | 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; } | 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; } | public int MaxUses { get; } | ||||
} | } | ||||
} | } |
@@ -1,10 +1,13 @@ | |||||
using System.Linq; | |||||
using System.Linq; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Represents a piece of audit log data related to an invite removal. | |||||
/// </summary> | |||||
public class InviteDeleteAuditLogData : IAuditLogData | public class InviteDeleteAuditLogData : IAuditLogData | ||||
{ | { | ||||
private InviteDeleteAuditLogData(int maxAge, string code, bool temporary, IUser inviter, ulong channelId, int uses, int maxUses) | private InviteDeleteAuditLogData(int maxAge, string code, bool temporary, IUser inviter, ulong channelId, int uses, int maxUses) | ||||
@@ -44,12 +47,57 @@ namespace Discord.Rest | |||||
return new InviteDeleteAuditLogData(maxAge, code, temporary, inviter, channelId, uses, maxUses); | return new InviteDeleteAuditLogData(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; } | 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; } | 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; } | 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; } | 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; } | 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; } | 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; } | public int MaxUses { get; } | ||||
} | } | ||||
} | } |
@@ -1,5 +1,8 @@ | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Represents information for an invite. | |||||
/// </summary> | |||||
public struct InviteInfo | public struct InviteInfo | ||||
{ | { | ||||
internal InviteInfo(int? maxAge, string code, bool? temporary, ulong? channelId, int? maxUses) | internal InviteInfo(int? maxAge, string code, bool? temporary, ulong? channelId, int? maxUses) | ||||
@@ -11,10 +14,45 @@ namespace Discord.Rest | |||||
MaxUses = maxUses; | MaxUses = 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; <c>null</c> if this | |||||
/// invite never expires or not specified. | |||||
/// </returns> | |||||
public int? MaxAge { get; } | 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; } | 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, | |||||
/// <c>false</c> if not; <c>null</c> if not specified. | |||||
/// </returns> | |||||
public bool? Temporary { get; } | public bool? Temporary { 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; | |||||
/// <c>null</c> if not specified. | |||||
/// </returns> | |||||
public ulong? ChannelId { get; } | public ulong? ChannelId { 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 specified. | |||||
/// </returns> | |||||
public int? MaxUses { get; } | public int? MaxUses { get; } | ||||
} | } | ||||
} | } |
@@ -1,4 +1,3 @@ | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -1,8 +1,7 @@ | |||||
using System.Linq; | |||||
using System.Linq; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
using ChangeModel = Discord.API.AuditLogChange; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
@@ -1,13 +1,7 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
using ChangeModel = Discord.API.AuditLogChange; | |||||
using OptionModel = Discord.API.AuditLogOptions; | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
@@ -1,21 +1,21 @@ | |||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
public struct RoleInfo | public struct RoleInfo | ||||
{ | |||||
internal RoleInfo(Color? color, bool? mentionable, bool? hoist, string name, | |||||
GuildPermissions? permissions) | |||||
{ | { | ||||
internal RoleInfo(Color? color, bool? mentionable, bool? hoist, string name, | |||||
GuildPermissions? permissions) | |||||
{ | |||||
Color = color; | |||||
Mentionable = mentionable; | |||||
Hoist = hoist; | |||||
Name = name; | |||||
Permissions = permissions; | |||||
} | |||||
public Color? Color { get; } | |||||
public bool? Mentionable { get; } | |||||
public bool? Hoist { get; } | |||||
public string Name { get; } | |||||
public GuildPermissions? Permissions { get; } | |||||
Color = color; | |||||
Mentionable = mentionable; | |||||
Hoist = hoist; | |||||
Name = name; | |||||
Permissions = permissions; | |||||
} | } | ||||
public Color? Color { get; } | |||||
public bool? Mentionable { get; } | |||||
public bool? Hoist { get; } | |||||
public string Name { get; } | |||||
public GuildPermissions? Permissions { get; } | |||||
} | |||||
} | } |
@@ -1,8 +1,4 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
@@ -1,8 +1,4 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
@@ -1,10 +1,13 @@ | |||||
using System.Linq; | |||||
using System.Linq; | |||||
using Model = Discord.API.AuditLog; | using Model = Discord.API.AuditLog; | ||||
using EntryModel = Discord.API.AuditLogEntry; | using EntryModel = Discord.API.AuditLogEntry; | ||||
namespace Discord.Rest | namespace Discord.Rest | ||||
{ | { | ||||
/// <summary> | |||||
/// Represents a REST-based audit log entry. | |||||
/// </summary> | |||||
public class RestAuditLogEntry : RestEntity<ulong>, IAuditLogEntry | public class RestAuditLogEntry : RestEntity<ulong>, IAuditLogEntry | ||||
{ | { | ||||
private RestAuditLogEntry(BaseDiscordClient discord, Model fullLog, EntryModel model, IUser user) | private RestAuditLogEntry(BaseDiscordClient discord, Model fullLog, EntryModel model, IUser user) | ||||