@@ -91,11 +91,11 @@ namespace Discord.WebSocket
public Task SyncPromise => _syncPromise.Task;
public Task SyncPromise => _syncPromise.Task;
public Task DownloaderPromise => _downloaderPromise.Task;
public Task DownloaderPromise => _downloaderPromise.Task;
/// <summary>
/// <summary>
/// Return s the <see cref="IAudioClient" /> associated with this guild.
/// Get s the <see cref="IAudioClient" /> associated with this guild.
/// </summary>
/// </summary>
public IAudioClient AudioClient => _audioClient;
public IAudioClient AudioClient => _audioClient;
/// <summary>
/// <summary>
/// Return s the first viewable text channel.
/// Get s the first viewable text channel.
/// </summary>
/// </summary>
/// <remarks>
/// <remarks>
/// This property does not guarantee the user can send message to it.
/// This property does not guarantee the user can send message to it.
@@ -105,7 +105,7 @@ namespace Discord.WebSocket
.OrderBy(c => c.Position)
.OrderBy(c => c.Position)
.FirstOrDefault();
.FirstOrDefault();
/// <summary>
/// <summary>
/// Return s the AFK voice channel, or <see langword="null" /> if none is set.
/// Get s the AFK voice channel, or <see langword="null" /> if none is set.
/// </summary>
/// </summary>
public SocketVoiceChannel AFKChannel
public SocketVoiceChannel AFKChannel
{
{
@@ -138,31 +138,34 @@ namespace Discord.WebSocket
}
}
}
}
/// <summary>
/// <summary>
/// Return s a collection of text channels present in this guild.
/// Get s a collection of text channels present in this guild.
/// </summary>
/// </summary>
public IReadOnlyCollection<SocketTextChannel> TextChannels
public IReadOnlyCollection<SocketTextChannel> TextChannels
=> Channels.Select(x => x as SocketTextChannel).Where(x => x != null).ToImmutableArray();
=> Channels.Select(x => x as SocketTextChannel).Where(x => x != null).ToImmutableArray();
/// <summary>
/// <summary>
/// Return s a collection of voice channels present in this guild.
/// Get s a collection of voice channels present in this guild.
/// </summary>
/// </summary>
public IReadOnlyCollection<SocketVoiceChannel> VoiceChannels
public IReadOnlyCollection<SocketVoiceChannel> VoiceChannels
=> Channels.Select(x => x as SocketVoiceChannel).Where(x => x != null).ToImmutableArray();
=> Channels.Select(x => x as SocketVoiceChannel).Where(x => x != null).ToImmutableArray();
/// <summary>
/// <summary>
/// Return s a collection of category channels present in this guild.
/// Get s a collection of category channels present in this guild.
/// </summary>
/// </summary>
public IReadOnlyCollection<SocketCategoryChannel> CategoryChannels
public IReadOnlyCollection<SocketCategoryChannel> CategoryChannels
=> Channels.Select(x => x as SocketCategoryChannel).Where(x => x != null).ToImmutableArray();
=> Channels.Select(x => x as SocketCategoryChannel).Where(x => x != null).ToImmutableArray();
/// <summary>
/// <summary>
/// Return s the current logged-in user.
/// Get s the current logged-in user.
/// </summary>
/// </summary>
public SocketGuildUser CurrentUser => _members.TryGetValue(Discord.CurrentUser.Id, out SocketGuildUser member) ? member : null;
public SocketGuildUser CurrentUser => _members.TryGetValue(Discord.CurrentUser.Id, out SocketGuildUser member) ? member : null;
/// <summary>
/// <summary>
/// Return s the @everyone role in this guild.
/// Get s the @everyone role in this guild.
/// </summary>
/// </summary>
public SocketRole EveryoneRole => GetRole(Id);
public SocketRole EveryoneRole => GetRole(Id);
/// <summary>
/// <summary>
/// Return s a collection of channels present in this guild.
/// Get s a collection of channels present in this guild.
/// </summary>
/// </summary>
/// <returns>
/// Collection of channels.
/// </returns>
public IReadOnlyCollection<SocketGuildChannel> Channels
public IReadOnlyCollection<SocketGuildChannel> Channels
{
{
get
get
@@ -175,10 +178,16 @@ namespace Discord.WebSocket
/// <summary>
/// <summary>
/// Gets a collection of emotes created in this guild.
/// Gets a collection of emotes created in this guild.
/// </summary>
/// </summary>
/// <returns>
/// Collection of emotes.
/// </returns>
public IReadOnlyCollection<GuildEmote> Emotes => _emotes;
public IReadOnlyCollection<GuildEmote> Emotes => _emotes;
/// <summary>
/// <summary>
/// Gets a collection of features enabled in this guild.
/// Gets a collection of features enabled in this guild.
/// </summary>
/// </summary>
/// <returns>
/// Collection of features in string.
/// </returns>
public IReadOnlyCollection<string> Features => _features;
public IReadOnlyCollection<string> Features => _features;
/// <summary>
/// <summary>
/// Gets a collection of users in this guild.
/// Gets a collection of users in this guild.
@@ -188,10 +197,16 @@ namespace Discord.WebSocket
/// You may need to enable <see cref="DiscordSocketConfig.AlwaysDownloadUsers"/> to fetch the full user list
/// 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.
/// upon startup, or use <see cref="DownloadUsersAsync"/> to manually download the users.
/// </remarks>
/// </remarks>
/// <returns>
/// Collection of users.
/// </returns>
public IReadOnlyCollection<SocketGuildUser> Users => _members.ToReadOnlyCollection();
public IReadOnlyCollection<SocketGuildUser> Users => _members.ToReadOnlyCollection();
/// <summary>
/// <summary>
/// Gets a collection of roles in this guild.
/// Gets a collection of roles in this guild.
/// </summary>
/// </summary>
/// <returns>
/// Collection of roles.
/// </returns>
public IReadOnlyCollection<SocketRole> Roles => _roles.ToReadOnlyCollection();
public IReadOnlyCollection<SocketRole> Roles => _roles.ToReadOnlyCollection();
internal SocketGuild(DiscordSocketClient client, ulong id)
internal SocketGuild(DiscordSocketClient client, ulong id)
@@ -378,7 +393,7 @@ namespace Discord.WebSocket
//Bans
//Bans
/// <summary>
/// <summary>
/// Get s a collection of the banned users in this guild.
/// Return s a collection of the banned users in this guild.
/// </summary>
/// </summary>
/// <param name="options">The options to be used when sending the request.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// <returns>
@@ -634,7 +649,7 @@ namespace Discord.WebSocket
/// <param name="id">The ID of the webhook.</param>
/// <param name="id">The ID of the webhook.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// <returns>
/// A webhook associated with the ID.
/// An awaitable Task containing the webhook associated with the ID.
/// </returns>
/// </returns>
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
=> GuildHelper.GetWebhookAsync(this, Discord, id, options);
=> GuildHelper.GetWebhookAsync(this, Discord, id, options);
@@ -643,7 +658,7 @@ namespace Discord.WebSocket
/// </summary>
/// </summary>
/// <param name="options">The options to be used when sending the request.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// <returns>
/// A collection of webhooks.
/// An awaitable Task containing a collection of webhooks.
/// </returns>
/// </returns>
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
=> GuildHelper.GetWebhooksAsync(this, Discord, options);
=> GuildHelper.GetWebhooksAsync(this, Discord, options);