feature: Support Gateway Intents (#1566)

* Support Gateway Intents

Allows supplying gateway intents through DiscordSocketConfig which will be passed through the IDENTIFY payload, in order to choose what gateway events you want to receive.

* Fixing enum casing

* Feedback

* Updating comment for GuildSubscriptions

* Comment update
This commit is contained in:
moiph
2020-06-17 20:40:10 -07:00
committed by GitHub
parent 5227241ba5
commit d5d10d32cf
5 changed files with 66 additions and 6 deletions

View File

@@ -121,9 +121,20 @@ namespace Discord.WebSocket
/// <summary>
/// Gets or sets enabling dispatching of guild subscription events e.g. presence and typing events.
/// This is not used if <see cref="GatewayIntents"/> are provided.
/// </summary>
public bool GuildSubscriptions { get; set; } = true;
/// <summary>
/// Gets or sets gateway intents to limit what events are sent from Discord. Allows for more granular control than the <see cref="GuildSubscriptions"/> property.
/// </summary>
/// <remarks>
/// For more information, please see
/// <see href="https://discord.com/developers/docs/topics/gateway#gateway-intents">GatewayIntents</see>
/// on the official Discord API documentation.
/// </remarks>
public GatewayIntents? GatewayIntents { get; set; }
/// <summary>
/// Initializes a default configuration.
/// </summary>