(binbrk)feature: Support filtering audit log entries on user, action type, and before entry id (#1377)

* Support filtering audit log entries on user, type, and before id

Adds support for filtering audit log entires with GetAuditLogsAsync. Adds the ability to specify a userId and ActionType to filter. Exposes the beforeId filter which was already implemented, yet unused (even when requesting > 100 entries)?

Was thinking that this could expose overloads of GetAuditLogAsync that accepts a IUser and IAuditLogEntry, but dealing with all the combinations of these types may be excessive.

* use only stringbuilder for args instead of string interpolation
This commit is contained in:
Chris Johnston
2019-09-20 15:36:02 -07:00
committed by Christopher F
parent c54867feba
commit 68eb71c175
6 changed files with 46 additions and 14 deletions

View File

@@ -1,8 +1,10 @@
namespace Discord.API.Rest
namespace Discord.API.Rest
{
class GetAuditLogsParams
{
public Optional<int> Limit { get; set; }
public Optional<ulong> BeforeEntryId { get; set; }
public Optional<ulong> UserId { get; set; }
public Optional<int> ActionType { get; set; }
}
}