Browse Source

First changes to the config

pull/1847/head
Paulo 4 years ago
parent
commit
8588cb58d6
3 changed files with 16 additions and 22 deletions
  1. +2
    -14
      src/Discord.Net.Core/DiscordConfig.cs
  2. +11
    -0
      src/Discord.Net.Core/GatewayIntents.cs
  3. +3
    -8
      src/Discord.Net.WebSocket/DiscordSocketConfig.cs

+ 2
- 14
src/Discord.Net.Core/DiscordConfig.cs View File

@@ -16,7 +16,7 @@ namespace Discord
/// <see href="https://discord.com/developers/docs/reference#api-versioning">Discord API documentation</see>
/// .</para>
/// </returns>
public const int APIVersion = 6;
public const int APIVersion = 9;
/// <summary>
/// Returns the Voice API version Discord.Net uses.
/// </summary>
@@ -43,7 +43,7 @@ namespace Discord
/// <returns>
/// The user agent used in each Discord.Net request.
/// </returns>
public static string UserAgent { get; } = $"DiscordBot (https://github.com/RogueException/Discord.Net, v{Version})";
public static string UserAgent { get; } = $"DiscordBot (https://github.com/discord-net/Discord.Net, v{Version})";
/// <summary>
/// Returns the base Discord API URL.
/// </summary>
@@ -141,18 +141,6 @@ namespace Discord
/// </remarks>
internal bool DisplayInitialLog { get; set; } = true;

/// <summary>
/// Gets or sets the level of precision of the rate limit reset response.
/// </summary>
/// <remarks>
/// If set to <see cref="RateLimitPrecision.Second"/>, this value will be rounded up to the
/// nearest second.
/// </remarks>
/// <returns>
/// The currently set <see cref="RateLimitPrecision"/>.
/// </returns>
public RateLimitPrecision RateLimitPrecision { get; set; } = RateLimitPrecision.Millisecond;

/// <summary>
/// Gets or sets whether or not rate-limits should use the system clock.
/// </summary>


+ 11
- 0
src/Discord.Net.Core/GatewayIntents.cs View File

@@ -39,5 +39,16 @@ namespace Discord
DirectMessageReactions = 1 << 13,
/// <summary> This intent includes TYPING_START </summary>
DirectMessageTyping = 1 << 14,
/// <summary>
/// This intent includes all but <see cref="GuildMembers"/> and <see cref="GuildMembers"/>
/// that are privileged must be enabled for the application.
/// </summary>
AllUnprivileged = Guilds | GuildBans | GuildEmojis | GuildIntegrations | GuildWebhooks | GuildInvites |
GuildVoiceStates | GuildMessages | GuildMessageReactions | GuildMessageTyping | DirectMessages |
DirectMessageReactions | DirectMessageTyping,
/// <summary>
/// This intent includes all of them, including privileged ones.
/// </summary>
All = AllUnprivileged | GuildMembers | GuildPresences
}
}

+ 3
- 8
src/Discord.Net.WebSocket/DiscordSocketConfig.cs View File

@@ -127,12 +127,6 @@ namespace Discord.WebSocket
/// </remarks>
public bool? ExclusiveBulkDelete { get; set; } = null;

/// <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 the maximum identify concurrency.
/// </summary>
@@ -172,14 +166,15 @@ namespace Discord.WebSocket
private int maxWaitForGuildAvailable = 10000;

/// <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.
/// Gets or sets gateway intents to limit what events are sent from Discord.
/// The default is <see cref="GatewayIntents.AllUnprivileged"/>.
/// </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; }
public GatewayIntents GatewayIntents { get; set; } = GatewayIntents.AllUnprivileged;

/// <summary>
/// Initializes a new instance of the <see cref="DiscordSocketConfig"/> class with the default configuration.


Loading…
Cancel
Save