Add support for audit log reasons (#708)

* Add support for audit log reasons

* Made changes per discussion
This commit is contained in:
Christopher F
2017-06-29 16:01:59 -04:00
committed by RogueException
parent 9085e44dda
commit 1ce1c019b3
19 changed files with 53 additions and 41 deletions

View File

@@ -66,7 +66,7 @@ namespace Discord.Net
_cancelToken = CancellationTokenSource.CreateLinkedTokenSource(_parentToken, _cancelTokenSource.Token).Token;
}
public async Task<RestResponse> SendAsync(string method, string endpoint, CancellationToken cancelToken, bool headerOnly)
public async Task<RestResponse> SendAsync(string method, string endpoint, CancellationToken cancelToken, bool headerOnly, string reason = null)
{
if (method != "GET")
throw new InvalidOperationException("This RestClient only supports GET requests.");
@@ -75,11 +75,11 @@ namespace Discord.Net
var bytes = await _blobCache.DownloadUrl(uri, _headers);
return new RestResponse(HttpStatusCode.OK, _headers, new MemoryStream(bytes));
}
public Task<RestResponse> SendAsync(string method, string endpoint, string json, CancellationToken cancelToken, bool headerOnly)
public Task<RestResponse> SendAsync(string method, string endpoint, string json, CancellationToken cancelToken, bool headerOnly, string reason = null)
{
throw new InvalidOperationException("This RestClient does not support payloads.");
}
public Task<RestResponse> SendAsync(string method, string endpoint, IReadOnlyDictionary<string, object> multipartParams, CancellationToken cancelToken, bool headerOnly)
public Task<RestResponse> SendAsync(string method, string endpoint, IReadOnlyDictionary<string, object> multipartParams, CancellationToken cancelToken, bool headerOnly, string reason = null)
{
throw new InvalidOperationException("This RestClient does not support multipart requests.");
}