예제 #1
0
        private async Task Request(HttpMethod method, string endpoint, CancellationToken cancellationToken, ResourceScope?scope = null, params object[] parameters)
        {
            var request = new DiscordHttpRequest(method, endpoint, parameters)
            {
                Scope = scope ?? new ResourceScope(),
            };

            using HttpResponseMessage response = await _client.Send(request, cancellationToken);
        }
예제 #2
0
        private async Task Request <TIn>(HttpMethod method, string endpoint, TIn data, CancellationToken cancellationToken, ResourceScope?scope = null, params object[] parameters)
        {
            using HttpContent content = Serialize(data);
            var request = new DiscordHttpRequest(method, endpoint, parameters)
            {
                Content = content,
                Scope   = scope ?? new ResourceScope(),
            };

            using HttpResponseMessage response = await _client.Send(request, cancellationToken);
        }