Browse Source

Change with_counts REST behaviour

pull/1023/head
Hsu Still 8 years ago
parent
commit
14b263f3bd
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net.Rest/DiscordRestApiClient.cs

+ 3
- 1
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -910,9 +910,11 @@ namespace Discord.API
if (index >= 0) if (index >= 0)
inviteId = inviteId.Substring(index + 1); inviteId = inviteId.Substring(index + 1);


var withCounts = args.WithCounts.GetValueOrDefault(false);

try try
{ {
return await SendJsonAsync<InviteMetadata>("GET", () => $"invites/{inviteId}", args, new BucketIds(), options: options).ConfigureAwait(false);
return await SendAsync<InviteMetadata>("GET", () => $"invites/{inviteId}?with_counts={withCounts}", new BucketIds(), options: options).ConfigureAwait(false);
} }
catch (HttpException ex) when (ex.HttpCode == HttpStatusCode.NotFound) { return null; } catch (HttpException ex) when (ex.HttpCode == HttpStatusCode.NotFound) { return null; }
} }


Loading…
Cancel
Save