Browse Source

Added Available to IGuild

tags/1.0-rc
RogueException 9 years ago
parent
commit
fe8a766133
3 changed files with 6 additions and 3 deletions
  1. +1
    -0
      src/Discord.Net/Entities/Guilds/Guild.cs
  2. +3
    -1
      src/Discord.Net/Entities/Guilds/IGuild.cs
  3. +2
    -2
      src/Discord.Net/Entities/WebSocket/CachedGuild.cs

+ 1
- 0
src/Discord.Net/Entities/Guilds/Guild.cs View File

@@ -303,6 +303,7 @@ namespace Discord

private string DebuggerDisplay => $"{Name} ({Id})";

bool IGuild.Available => false;
IRole IGuild.EveryoneRole => EveryoneRole;
IReadOnlyCollection<Emoji> IGuild.Emojis => Emojis;
IReadOnlyCollection<string> IGuild.Features => Features;


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

@@ -18,6 +18,8 @@ namespace Discord
string IconUrl { get; }
/// <summary> Returns the url to this guild's splash image, or null if one is not set. </summary>
string SplashUrl { get; }
/// <summary> Returns true if this guild is currently connected and ready to be used. Only applies to the WebSocket client. </summary>
bool Available { get; }

/// <summary> Gets the id of the AFK voice channel for this guild if set, or null if not. </summary>
ulong? AFKChannelId { get; }
@@ -90,7 +92,7 @@ namespace Discord
Task<IGuildUser> GetUserAsync(ulong id);
/// <summary> Gets the current user for this guild. </summary>
Task<IGuildUser> GetCurrentUserAsync();
/// <summary> Downloads all users for this guild if the current list is incomplete. </summary>
/// <summary> Downloads all users for this guild if the current list is incomplete. Only applies to the WebSocket client. </summary>
Task DownloadUsersAsync();
/// <summary> Removes all users from this guild if they have not logged on in a provided number of days or, if simulate is true, returns the number of users that would be removed. </summary>
Task<int> PruneUsersAsync(int days = 30, bool simulate = false);


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

@@ -24,7 +24,7 @@ namespace Discord
private ConcurrentDictionary<ulong, Presence> _presences;
private ConcurrentDictionary<ulong, VoiceState> _voiceStates;

public bool Available { get; private set; } //TODO: Add to IGuild
public bool Available { get; private set; }
public int MemberCount { get; private set; }
public int DownloadedMemberCount { get; private set; }

@@ -102,7 +102,7 @@ namespace Discord
if (model.VoiceStates != null)
{
for (int i = 0; i < model.VoiceStates.Length; i++)
AddOrUpdateCachedVoiceState(model.VoiceStates[i], _voiceStates);
AddOrUpdateCachedVoiceState(model.VoiceStates[i], voiceStates);
}
_voiceStates = voiceStates;
}


Loading…
Cancel
Save