feature: Bump API version to 9 (#1847)

* First changes to the config

* Lots of changes to fit the new version

* Remove PermissionTargetConverter
This commit is contained in:
Paulo
2021-05-24 11:39:20 -03:00
committed by GitHub
parent 690bc3ff9d
commit 06a64b7877
43 changed files with 82 additions and 436 deletions

View File

@@ -40,9 +40,8 @@ namespace Discord.API
public DiscordSocketApiClient(RestClientProvider restClientProvider, WebSocketProvider webSocketProvider, string userAgent,
string url = null, RetryMode defaultRetryMode = RetryMode.AlwaysRetry, JsonSerializer serializer = null,
RateLimitPrecision rateLimitPrecision = RateLimitPrecision.Second,
bool useSystemClock = true)
: base(restClientProvider, userAgent, defaultRetryMode, serializer, rateLimitPrecision, useSystemClock)
: base(restClientProvider, userAgent, defaultRetryMode, serializer, useSystemClock)
{
_gatewayUrl = url;
if (url != null)
@@ -216,7 +215,7 @@ namespace Discord.API
await _sentGatewayMessageEvent.InvokeAsync(opCode).ConfigureAwait(false);
}
public async Task SendIdentifyAsync(int largeThreshold = 100, int shardID = 0, int totalShards = 1, bool guildSubscriptions = true, GatewayIntents? gatewayIntents = null, (UserStatus, bool, long?, GameModel)? presence = null, RequestOptions options = null)
public async Task SendIdentifyAsync(int largeThreshold = 100, int shardID = 0, int totalShards = 1, GatewayIntents gatewayIntents = GatewayIntents.AllUnprivileged, (UserStatus, bool, long?, GameModel)? presence = null, RequestOptions options = null)
{
options = RequestOptions.CreateOrClone(options);
var props = new Dictionary<string, string>
@@ -234,10 +233,7 @@ namespace Discord.API
options.BucketId = GatewayBucket.Get(GatewayBucketType.Identify).Id;
if (gatewayIntents.HasValue)
msg.Intents = (int)gatewayIntents.Value;
else
msg.GuildSubscriptions = guildSubscriptions;
msg.Intents = (int)gatewayIntents;
if (presence.HasValue)
{