Browse Source

Merge branch 'docs/pre-release' of https://github.com/Still34/Discord.Net into docs/pre-release

Merge remote upstream
pull/1161/head
sarcasmloading 7 years ago
parent
commit
1f4718e60c
5 changed files with 29 additions and 13 deletions
  1. +1
    -1
      src/Discord.Net.Core/Entities/Guilds/IGuild.cs
  2. +6
    -1
      src/Discord.Net.Core/Entities/ISnowflakeEntity.cs
  3. +1
    -1
      src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
  4. +19
    -9
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
  5. +2
    -1
      src/Discord.Net.WebSocket/Entities/SocketEntity.cs

+ 1
- 1
src/Discord.Net.Core/Entities/Guilds/IGuild.cs View File

@@ -590,7 +590,7 @@ namespace Discord
/// A task that represents the asynchronous get operation. The task result contains a read-only collection /// A task that represents the asynchronous get operation. The task result contains a read-only collection
/// of the requested audit log entries. /// of the requested audit log entries.
/// </returns> /// </returns>
Task<IReadOnlyCollection<IAuditLogEntry>> GetAuditLogAsync(int limit = DiscordConfig.MaxAuditLogEntriesPerBatch,
Task<IReadOnlyCollection<IAuditLogEntry>> GetAuditLogsAsync(int limit = DiscordConfig.MaxAuditLogEntriesPerBatch,
CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);


/// <summary> /// <summary>


+ 6
- 1
src/Discord.Net.Core/Entities/ISnowflakeEntity.cs View File

@@ -5,7 +5,12 @@ namespace Discord
/// <summary> Represents a Discord snowflake entity. </summary> /// <summary> Represents a Discord snowflake entity. </summary>
public interface ISnowflakeEntity : IEntity<ulong> public interface ISnowflakeEntity : IEntity<ulong>
{ {
/// <summary> Gets when the snowflake is created. </summary>
/// <summary>
/// Gets when the snowflake is created.
/// </summary>
/// <returns>
/// A <see cref="DateTimeOffset"/> representing when the entity was first created.
/// </returns>
DateTimeOffset CreatedAt { get; } DateTimeOffset CreatedAt { get; }
} }
} }

+ 1
- 1
src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs View File

@@ -553,7 +553,7 @@ namespace Discord.Rest
Task IGuild.DownloadUsersAsync() => Task IGuild.DownloadUsersAsync() =>
throw new NotSupportedException(); throw new NotSupportedException();


async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogAsync(int limit, CacheMode cacheMode, RequestOptions options)
async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options)
{ {
if (cacheMode == CacheMode.AllowDownload) if (cacheMode == CacheMode.AllowDownload)
return (await GetAuditLogsAsync(limit, options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray(); return (await GetAuditLogsAsync(limit, options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray();


+ 19
- 9
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -56,11 +56,15 @@ namespace Discord.WebSocket
/// <remarks> /// <remarks>
/// This property retrieves the number of members returned by Discord. /// This property retrieves the number of members returned by Discord.
/// <note type="tip"> /// <note type="tip">
/// <para>
/// Due to how this property is returned by Discord instead of relying on the WebSocket cache, the /// Due to how this property is returned by Discord instead of relying on the WebSocket cache, the
/// number here is the most accurate in terms of counting the number of users within this guild. Use
/// this instead of enumerating the count of the <see cref="Discord.WebSocket.SocketGuild.Users" />
/// collection, as you may see discrepancy between the count of
/// <see cref="Discord.WebSocket.SocketGuild.Users" />collection and this property.
/// number here is the most accurate in terms of counting the number of users within this guild.
/// </para>
/// <para>
/// Use this instead of enumerating the count of the
/// <see cref="Discord.WebSocket.SocketGuild.Users" /> collection, as you may see discrepancy
/// between that and this property.
/// </para>
/// </note> /// </note>
/// </remarks> /// </remarks>
public int MemberCount { get; internal set; } public int MemberCount { get; internal set; }
@@ -220,10 +224,16 @@ namespace Discord.WebSocket
/// <remarks> /// <remarks>
/// This property retrieves all users found within this guild. /// This property retrieves all users found within this guild.
/// <note type="warning"> /// <note type="warning">
/// This property may not always return all the members for large guilds (i.e. guilds containing 100+ users).
/// If you are simply looking to get the number of users present in this guild, consider <see cref="MemberCount"/> instead.
/// Otherwise, you may need to enable <see cref="DiscordSocketConfig.AlwaysDownloadUsers"/> to fetch the full user list
/// upon startup, or use <see cref="DownloadUsersAsync"/> to manually download the users.
/// <para>
/// This property may not always return all the members for large guilds (i.e. guilds containing
/// 100+ users). If you are simply looking to get the number of users present in this guild,
/// consider using <see cref="MemberCount"/> instead.
/// </para>
/// <para>
/// Otherwise, you may need to enable <see cref="DiscordSocketConfig.AlwaysDownloadUsers"/> to fetch
/// the full user list upon startup, or use <see cref="DownloadUsersAsync"/> to manually download
/// the users.
/// </para>
/// </note> /// </note>
/// </remarks> /// </remarks>
/// <returns> /// <returns>
@@ -1061,7 +1071,7 @@ namespace Discord.WebSocket
=> Task.FromResult<IGuildUser>(Owner); => Task.FromResult<IGuildUser>(Owner);


/// <inheritdoc /> /// <inheritdoc />
async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogAsync(int limit, CacheMode cacheMode, RequestOptions options)
async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options)
{ {
if (cacheMode == CacheMode.AllowDownload) if (cacheMode == CacheMode.AllowDownload)
return (await GetAuditLogsAsync(limit, options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray(); return (await GetAuditLogsAsync(limit, options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray();


+ 2
- 1
src/Discord.Net.WebSocket/Entities/SocketEntity.cs View File

@@ -1,4 +1,4 @@
using System;
using System;


namespace Discord.WebSocket namespace Discord.WebSocket
{ {
@@ -6,6 +6,7 @@ namespace Discord.WebSocket
where T : IEquatable<T> where T : IEquatable<T>
{ {
internal DiscordSocketClient Discord { get; } internal DiscordSocketClient Discord { get; }
/// <inheritdoc />
public T Id { get; } public T Id { get; }


internal SocketEntity(DiscordSocketClient discord, T id) internal SocketEntity(DiscordSocketClient discord, T id)


Loading…
Cancel
Save