diff options
| author | acdenisSK <[email protected]> | 2017-11-01 13:55:29 +0100 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-11-01 13:55:29 +0100 |
| commit | f4918098fcbb6df6129504428e44ccb363ef4ff8 (patch) | |
| tree | 039d68278b2fb038bb6eaa3f2e258654d0a51305 /src/http | |
| parent | Add a fallback to `RoleId::from_str` as well (diff) | |
| download | serenity-f4918098fcbb6df6129504428e44ccb363ef4ff8.tar.xz serenity-f4918098fcbb6df6129504428e44ccb363ef4ff8.zip | |
Fix audit logs a bit
Diffstat (limited to 'src/http')
| -rw-r--r-- | src/http/mod.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/http/mod.rs b/src/http/mod.rs index 3fb5b7b..239c777 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -1055,12 +1055,20 @@ pub fn get_bans(guild_id: u64) -> Result<Vec<Ban>> { } /// Gets all audit logs in a specific guild. -pub fn get_audit_logs(guild_id: u64) -> Result<AuditLogs> { +pub fn get_audit_logs(guild_id: u64, + action_type: Option<u8>, + user_id: Option<u64>, + before: Option<u64>, + limit: Option<u8>) -> Result<AuditLogs> { let response = request!( Route::GuildsIdAuditLogs(guild_id), get, - "/guilds/{}/audit-logs", - guild_id + "/guilds/{}/audit-logs?user_id={}&action_type={}&before={}&limit={}", + guild_id, + user_id.unwrap_or(0), + action_type.unwrap_or(0), + before.unwrap_or(0), + limit.unwrap_or(50), ); serde_json::from_reader::<HyperResponse, AuditLogs>(response) |