Browse Source

Add XMLDocs

pull/988/head
Hsu Still 7 years ago
parent
commit
9f536177fa
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
6 changed files with 132 additions and 22 deletions
  1. +1
    -1
      src/Discord.Net.Commands/Attributes/GroupAttribute.cs
  2. +3
    -0
      src/Discord.Net.Commands/Attributes/NameAttribute.cs
  3. +1
    -0
      src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs
  4. +1
    -1
      src/Discord.Net.Commands/CommandException.cs
  5. +54
    -20
      src/Discord.Net.Core/Entities/Guilds/IGuild.cs
  6. +72
    -0
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs

+ 1
- 1
src/Discord.Net.Commands/Attributes/GroupAttribute.cs View File

@@ -14,7 +14,7 @@ namespace Discord.Commands
Prefix = null;
}
/// <summary> Creates a <see cref="GroupAttribute"/> with the provided prefix. </summary>
/// <param name="prefix"> The prefix of the module group.</param>
/// <param name="prefix"> The prefix of the module group. </param>
public GroupAttribute(string prefix)
{
Prefix = prefix;


+ 3
- 0
src/Discord.Net.Commands/Attributes/NameAttribute.cs View File

@@ -7,8 +7,11 @@ namespace Discord.Commands
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class NameAttribute : Attribute
{
/// <summary> Gets the name of the command. </summary>
public string Text { get; }

/// <summary> Marks the public name of a command, module, or parameter with the provided name. </summary>
/// <param name="text"> The public name of the object. </param>
public NameAttribute(string text)
{
Text = text;


+ 1
- 0
src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs View File

@@ -3,6 +3,7 @@ using System.Threading.Tasks;

namespace Discord.Commands
{
/// <summary> Requires the module or class to pass the specified precondition before execution can begin. </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public abstract class PreconditionAttribute : Attribute
{


+ 1
- 1
src/Discord.Net.Commands/CommandException.cs View File

@@ -2,7 +2,7 @@ using System;

namespace Discord.Commands
{
/// <summary> An exception thrown when a command fails to execute. </summary>
/// <summary> Thrown when a command fails to execute. </summary>
public class CommandException : Exception
{
/// <summary> The command that caused the exception. </summary>


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

@@ -1,4 +1,4 @@
using Discord.Audio;
using Discord.Audio;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
@@ -15,34 +15,34 @@ namespace Discord
bool IsEmbeddable { get; }
/// <summary> Gets the default message notifications for users who haven't explicitly set their notification settings. </summary>
DefaultMessageNotifications DefaultMessageNotifications { get; }
/// <summary> Gets the level of mfa requirements a user must fulfill before being allowed to perform administrative actions in this guild. </summary>
/// <summary> Gets the level of Multi-Factor Authentication requirements a user must fulfill before being allowed to perform administrative actions in this guild. </summary>
MfaLevel MfaLevel { get; }
/// <summary> Gets the level of requirements a user must fulfill before being allowed to post messages in this guild. </summary>
VerificationLevel VerificationLevel { get; }
/// <summary> Returns the id of this guild's icon, or null if one is not set. </summary>
/// <summary> Returns the ID of this guild's icon, or null if one is not set. </summary>
string IconId { get; }
/// <summary> Returns the url to this guild's icon, or null if one is not set. </summary>
string IconUrl { get; }
/// <summary> Returns the id of this guild's splash image, or null if one is not set. </summary>
/// <summary> Returns the ID of this guild's splash image, or null if one is not set. </summary>
string SplashId { 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>
/// <summary> Gets the ID of the AFK voice channel for this guild if set, or null if not. </summary>
ulong? AFKChannelId { get; }
/// <summary> Gets the id of the the default channel for this guild. </summary>
/// <summary> Gets the ID of the the default channel for this guild. </summary>
ulong DefaultChannelId { get; }
/// <summary> Gets the id of the embed channel for this guild if set, or null if not. </summary>
/// <summary> Gets the ID of the embed channel for this guild if set, or null if not. </summary>
ulong? EmbedChannelId { get; }
/// <summary> Gets the id of the channel where randomized welcome messages are sent, or null if not. </summary>
/// <summary> Gets the ID of the channel where randomized welcome messages are sent, or null if not. </summary>
ulong? SystemChannelId { get; }
/// <summary> Gets the id of the user that created this guild. </summary>
/// <summary> Gets the ID of the user that created this guild. </summary>
ulong OwnerId { get; }
/// <summary> Gets the id of the region hosting this guild's voice channels. </summary>
/// <summary> Gets the ID of the region hosting this guild's voice channels. </summary>
string VoiceRegionId { get; }
/// <summary> Gets the IAudioClient currently associated with this guild. </summary>
/// <summary> Gets the <see cref="IAudioClient"/> currently associated with this guild. </summary>
IAudioClient AudioClient { get; }
/// <summary> Gets the built-in role containing all users in this guild. </summary>
IRole EveryoneRole { get; }
@@ -67,34 +67,53 @@ namespace Discord
/// <summary> Gets a collection of all users banned on this guild. </summary>
Task<IReadOnlyCollection<IBan>> GetBansAsync(RequestOptions options = null);
/// <summary> Bans the provided user from this guild and optionally prunes their recent messages. </summary>
/// <param name="pruneDays">The number of days to remove messages from this user for - must be between [0, 7]</param>
/// <param name="user"> The user to ban. </param>
/// <param name="pruneDays"> The number of days to remove messages from this user for - must be between [0, 7]</param>
/// <param name="reason"> The reason of the ban to be written in the audit log. </param>
Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null);
/// <summary> Bans the provided user id from this guild and optionally prunes their recent messages. </summary>
/// <summary> Bans the provided user ID from this guild and optionally prunes their recent messages. </summary>
/// <param name="userId"> The ID of the user to ban. </param>
/// <param name="pruneDays">The number of days to remove messages from this user for - must be between [0, 7]</param>
/// <param name="reason"> The reason of the ban to be written in the audit log. </param>
Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null);
/// <summary> Unbans the provided user if it is currently banned. </summary>
Task RemoveBanAsync(IUser user, RequestOptions options = null);
/// <summary> Unbans the provided user id if it is currently banned. </summary>
/// <summary> Unbans the provided user ID if it is currently banned. </summary>
Task RemoveBanAsync(ulong userId, RequestOptions options = null);

/// <summary> Gets a collection of all channels in this guild. </summary>
Task<IReadOnlyCollection<IGuildChannel>> GetChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets the channel in this guild with the provided id, or null if not found. </summary>
/// <summary> Gets the channel in this guild with the provided ID, or null if not found. </summary>
/// <param name="id"> The channel ID. </param>
Task<IGuildChannel> GetChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets a collection of all text channels in this guild. </summary>
Task<IReadOnlyCollection<ITextChannel>> GetTextChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets a text channel in this guild with the provided ID, or null if not found. </summary>
/// <param name="id"> The text channel ID. </param>
Task<ITextChannel> GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets a collection of all voice channels in this guild. </summary>
Task<IReadOnlyCollection<IVoiceChannel>> GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets a collection of all category channels in this guild. </summary>
Task<IReadOnlyCollection<ICategoryChannel>> GetCategoriesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets the voice channel in this guild with the provided ID, or null if not found. </summary>
/// <param name="id"> The text channel ID. </param>
Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets the voice AFK channel in this guild with the provided ID, or null if not found. </summary>
Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets the default system text channel in this guild with the provided ID, or null if none is set. </summary>
Task<ITextChannel> GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets the top viewable text channel in this guild with the provided ID, or null if not found. </summary>
Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets the embed channel in this guild. </summary>
Task<IGuildChannel> GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Creates a new text channel. </summary>
/// <param name="name"> The new name for the text channel. </param>
Task<ITextChannel> CreateTextChannelAsync(string name, RequestOptions options = null);
/// <summary> Creates a new voice channel. </summary>
/// <param name="name"> The new name for the voice channel. </param>
Task<IVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null);
/// <summary> Creates a new channel category. </summary>
/// <param name="name"> The new name for the category. </param>
Task<ICategoryChannel> CreateCategoryAsync(string name, RequestOptions options = null);

Task<IReadOnlyCollection<IGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null);
@@ -103,14 +122,20 @@ namespace Discord
/// <summary> Gets a collection of all invites to this guild. </summary>
Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null);

/// <summary> Gets the role in this guild with the provided id, or null if not found. </summary>
/// <summary> Gets the role in this guild with the provided ID, or null if not found. </summary>
/// <param name="id"> The role ID. </param>
IRole GetRole(ulong id);
/// <summary> Creates a new role. </summary>
/// <summary> Creates a new role with the provided name. </summary>
/// <param name="name"> The new name for the role. </param>
/// <param name="permissions"> The guild permission that the role should possess. </param>
/// <param name="color"> The color of the role. </param>
/// <param name="isHoisted"> Whether the role is separated from others on the sidebar. </param>
Task<IRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, RequestOptions options = null);

/// <summary> Gets a collection of all users in this guild. </summary>
Task<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); //TODO: shouldnt this be paged?
/// <summary> Gets the user in this guild with the provided id, or null if not found. </summary>
/// <summary> Gets the user in this guild with the provided ID, or null if not found. </summary>
/// <param name="id"> The user ID. </param>
Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
/// <summary> Gets the current user for this guild. </summary>
Task<IGuildUser> GetCurrentUserAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
@@ -119,20 +144,29 @@ namespace Discord
/// <summary> Downloads all users for this guild if the current list is incomplete. </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>
/// <param name="days"> The number of days required for the users to be kicked. </param>
/// <param name="simulate"> Whether this prune action is a simulation. </param>
/// <return> The number of users removed from this guild. </return>
Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null);

/// <summary> Gets the webhook in this guild with the provided id, or null if not found. </summary>
/// <summary> Gets the webhook in this guild with the provided ID, or null if not found. </summary>
/// <param name="id"> The webhook ID. </param>
Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null);
/// <summary> Gets a collection of all webhooks for this guild. </summary>
Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null);
/// <summary> Gets a specific emote from this guild. </summary>
/// <param name="id"> The guild emote ID. </param>
Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null);
/// <summary> Creates a new emote in this guild. </summary>
/// <param name="name"> The name of the guild emote. </param>
/// <param name="image"> The image of the new emote. </param>
/// <param name="roles"> The roles to limit the emote usage to. </param>
Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null);
/// <summary> Modifies an existing emote in this guild. </summary>
Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null);
/// <summary> Deletes an existing emote from this guild. </summary>
/// <param name="emote"> The guild emote to delete. </param>
Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null);
}
}
}

+ 72
- 0
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -34,30 +34,53 @@ namespace Discord.WebSocket
private ImmutableArray<string> _features;
private AudioClient _audioClient;

/// <inheritdoc />
public string Name { get; private set; }
/// <inheritdoc />
public int AFKTimeout { get; private set; }
/// <inheritdoc />
public bool IsEmbeddable { get; private set; }
/// <inheritdoc />
public VerificationLevel VerificationLevel { get; private set; }
/// <inheritdoc />
public MfaLevel MfaLevel { get; private set; }
/// <inheritdoc />
public DefaultMessageNotifications DefaultMessageNotifications { get; private set; }
/// <summary> Gets the number of members. </summary>
/// <remark>
/// The number of members is returned by Discord and is the most accurate.
/// You may see discrepancy between the Users collection and this.
/// </remark>
public int MemberCount { get; internal set; }
/// <summary> Gets the number of members downloaded to the local guild cache. </summary>
public int DownloadedMemberCount { get; private set; }
internal bool IsAvailable { get; private set; }
/// <summary> Indicates whether the client is connected to this guild. </summary>
public bool IsConnected { get; internal set; }

internal ulong? AFKChannelId { get; private set; }
internal ulong? EmbedChannelId { get; private set; }
internal ulong? SystemChannelId { get; private set; }
/// <inheritdoc />
public ulong OwnerId { get; private set; }
/// <summary> Gets the user that owns this guild. </summary>
public SocketGuildUser Owner => GetUser(OwnerId);
/// <inheritdoc />
public string VoiceRegionId { get; private set; }
/// <inheritdoc />
public string IconId { get; private set; }
/// <inheritdoc />
public string SplashId { get; private set; }

/// <inheritdoc />
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
/// <inheritdoc />
public string IconUrl => CDN.GetGuildIconUrl(Id, IconId);
/// <inheritdoc />
public string SplashUrl => CDN.GetGuildSplashUrl(Id, SplashId);
/// <summary> Indicates whether the client has all the members downloaded to the local guild cache. </summary>
public bool HasAllMembers => MemberCount == DownloadedMemberCount;// _downloaderPromise.Task.IsCompleted;
/// <summary> Indicates whether the guild cache is synced to this guild. </summary>
public bool IsSynced => _syncPromise.Task.IsCompleted;
public Task SyncPromise => _syncPromise.Task;
public Task DownloaderPromise => _downloaderPromise.Task;
@@ -270,32 +293,43 @@ namespace Discord.WebSocket
}

//General
/// <inheritdoc />
public Task DeleteAsync(RequestOptions options = null)
=> GuildHelper.DeleteAsync(this, Discord, options);

/// <inheritdoc />
public Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
=> GuildHelper.ModifyAsync(this, Discord, func, options);
/// <inheritdoc />
public Task ModifyEmbedAsync(Action<GuildEmbedProperties> func, RequestOptions options = null)
=> GuildHelper.ModifyEmbedAsync(this, Discord, func, options);
/// <inheritdoc />
public Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
=> GuildHelper.ReorderChannelsAsync(this, Discord, args, options);
/// <inheritdoc />
public Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
=> GuildHelper.ReorderRolesAsync(this, Discord, args, options);

/// <inheritdoc />
public Task LeaveAsync(RequestOptions options = null)
=> GuildHelper.LeaveAsync(this, Discord, options);

//Bans
/// <summary> Gets a collection of the banned users in this guild. </summary>
public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null)
=> GuildHelper.GetBansAsync(this, Discord, options);

/// <inheritdoc />
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
=> GuildHelper.AddBanAsync(this, Discord, user.Id, pruneDays, reason, options);
/// <inheritdoc />
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
=> GuildHelper.AddBanAsync(this, Discord, userId, pruneDays, reason, options);

/// <inheritdoc />
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
=> GuildHelper.RemoveBanAsync(this, Discord, user.Id, options);
/// <inheritdoc />
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
=> GuildHelper.RemoveBanAsync(this, Discord, userId, options);

@@ -441,12 +475,16 @@ namespace Discord.WebSocket
=> GuildHelper.GetWebhooksAsync(this, Discord, options);

//Emotes
/// <inheritdoc />
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
=> GuildHelper.GetEmoteAsync(this, Discord, id, options);
/// <inheritdoc />
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null)
=> GuildHelper.CreateEmoteAsync(this, Discord, name, image, roles, options);
/// <inheritdoc />
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
=> GuildHelper.ModifyEmoteAsync(this, Discord, emote.Id, func, options);
/// <inheritdoc />
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
=> GuildHelper.DeleteEmoteAsync(this, Discord, emote.Id, options);

@@ -630,71 +668,105 @@ namespace Discord.WebSocket
internal SocketGuild Clone() => MemberwiseClone() as SocketGuild;

//IGuild
/// <inheritdoc />
ulong? IGuild.AFKChannelId => AFKChannelId;
/// <inheritdoc />
IAudioClient IGuild.AudioClient => null;
/// <inheritdoc />
bool IGuild.Available => true;
/// <inheritdoc />
ulong IGuild.DefaultChannelId => DefaultChannel?.Id ?? 0;
/// <inheritdoc />
ulong? IGuild.EmbedChannelId => EmbedChannelId;
/// <inheritdoc />
ulong? IGuild.SystemChannelId => SystemChannelId;
/// <inheritdoc />
IRole IGuild.EveryoneRole => EveryoneRole;
/// <inheritdoc />
IReadOnlyCollection<IRole> IGuild.Roles => Roles;

/// <inheritdoc />
async Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options)
=> await GetBansAsync(options).ConfigureAwait(false);

/// <inheritdoc />
Task<IReadOnlyCollection<IGuildChannel>> IGuild.GetChannelsAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IReadOnlyCollection<IGuildChannel>>(Channels);
/// <inheritdoc />
Task<IGuildChannel> IGuild.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
=> Task.FromResult<IGuildChannel>(GetChannel(id));
/// <inheritdoc />
Task<IReadOnlyCollection<ITextChannel>> IGuild.GetTextChannelsAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IReadOnlyCollection<ITextChannel>>(TextChannels);
/// <inheritdoc />
Task<ITextChannel> IGuild.GetTextChannelAsync(ulong id, CacheMode mode, RequestOptions options)
=> Task.FromResult<ITextChannel>(GetTextChannel(id));
/// <inheritdoc />
Task<IReadOnlyCollection<IVoiceChannel>> IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IReadOnlyCollection<IVoiceChannel>>(VoiceChannels);
/// <inheritdoc />
Task<IReadOnlyCollection<ICategoryChannel>> IGuild.GetCategoriesAsync(CacheMode mode , RequestOptions options)
=> Task.FromResult<IReadOnlyCollection<ICategoryChannel>>(CategoryChannels);
/// <inheritdoc />
Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options)
=> Task.FromResult<IVoiceChannel>(GetVoiceChannel(id));
/// <inheritdoc />
Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IVoiceChannel>(AFKChannel);
/// <inheritdoc />
Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<ITextChannel>(DefaultChannel);
/// <inheritdoc />
Task<IGuildChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IGuildChannel>(EmbedChannel);
/// <inheritdoc />
Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<ITextChannel>(SystemChannel);
/// <inheritdoc />
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, RequestOptions options)
=> await CreateTextChannelAsync(name, options).ConfigureAwait(false);
/// <inheritdoc />
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, RequestOptions options)
=> await CreateVoiceChannelAsync(name, options).ConfigureAwait(false);
/// <inheritdoc />
async Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, RequestOptions options)
=> await CreateCategoryChannelAsync(name, options).ConfigureAwait(false);

/// <inheritdoc />
async Task<IReadOnlyCollection<IGuildIntegration>> IGuild.GetIntegrationsAsync(RequestOptions options)
=> await GetIntegrationsAsync(options).ConfigureAwait(false);
/// <inheritdoc />
async Task<IGuildIntegration> IGuild.CreateIntegrationAsync(ulong id, string type, RequestOptions options)
=> await CreateIntegrationAsync(id, type, options).ConfigureAwait(false);

/// <inheritdoc />
async Task<IReadOnlyCollection<IInviteMetadata>> IGuild.GetInvitesAsync(RequestOptions options)
=> await GetInvitesAsync(options).ConfigureAwait(false);

/// <inheritdoc />
IRole IGuild.GetRole(ulong id)
=> GetRole(id);
/// <inheritdoc />
async Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, RequestOptions options)
=> await CreateRoleAsync(name, permissions, color, isHoisted, options).ConfigureAwait(false);

/// <inheritdoc />
Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IReadOnlyCollection<IGuildUser>>(Users);
/// <inheritdoc />
Task<IGuildUser> IGuild.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
=> Task.FromResult<IGuildUser>(GetUser(id));
/// <inheritdoc />
Task<IGuildUser> IGuild.GetCurrentUserAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IGuildUser>(CurrentUser);
/// <inheritdoc />
Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IGuildUser>(Owner);

/// <inheritdoc />
async Task<IWebhook> IGuild.GetWebhookAsync(ulong id, RequestOptions options)
=> await GetWebhookAsync(id, options);
/// <inheritdoc />
async Task<IReadOnlyCollection<IWebhook>> IGuild.GetWebhooksAsync(RequestOptions options)
=> await GetWebhooksAsync(options);
}


Loading…
Cancel
Save