/// <inheritdoc /> public Task <RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action <AddGuildUserProperties> func = null, RequestOptions options = null) => GuildHelper.AddGuildUserAsync(this, Discord, id, accessToken, func, options);
/// <inheritdoc /> /// <exception cref="ArgumentNullException"><paramref name="func"/> is <c>null</c>.</exception> public async Task ModifyEmbedAsync(Action <GuildEmbedProperties> func, RequestOptions options = null) { var model = await GuildHelper.ModifyEmbedAsync(this, Discord, func, options).ConfigureAwait(false); Update(model); }
/// <inheritdoc /> public Task LeaveAsync(RequestOptions options = null) => GuildHelper.LeaveAsync(this, Discord, options);
public Task <RestGuildUser> GetCurrentUserAsync(RequestOptions options = null) => GuildHelper.GetUserAsync(this, Discord, Discord.CurrentUser.Id, options);
public Task <int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null) => GuildHelper.PruneUsersAsync(this, Discord, days, simulate, options);
public Task <RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null) => GuildHelper.CreateIntegrationAsync(this, Discord, id, type, options);
//Users public IAsyncEnumerable <IReadOnlyCollection <RestGuildUser> > GetUsersAsync(RequestOptions options = null) => GuildHelper.GetUsersAsync(this, Discord, null, null, options);
//Webhooks /// <summary> /// Gets a webhook found within this guild. /// </summary> /// <param name="id">The identifier for the webhook.</param> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// A task that represents the asynchronous get operation. The task result contains the webhook with the /// specified <paramref name="id"/>; <c>null</c> if none is found. /// </returns> public Task <RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null) => GuildHelper.GetWebhookAsync(this, Discord, id, options);
//Emotes /// <inheritdoc /> public Task <GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null) => GuildHelper.GetEmoteAsync(this, Discord, id, options);
/// <summary> /// Gets the vanity invite URL of this guild. /// </summary> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// A partial metadata of the vanity invite found within this guild. /// </returns> public Task <RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null) => GuildHelper.GetVanityInviteAsync(this, Discord, options);
//Audit logs /// <summary> /// Gets the specified number of audit log entries for this guild. /// </summary> /// <param name="limit">The number of audit log entries to fetch.</param> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// A task that represents the asynchronous get operation. The task result contains a read-only collection /// of the requested audit log entries. /// </returns> public IAsyncEnumerable <IReadOnlyCollection <RestAuditLogEntry> > GetAuditLogsAsync(int limit, RequestOptions options = null) => GuildHelper.GetAuditLogsAsync(this, Discord, null, limit, options);
/// <summary> /// Creates a voice channel with the provided name. /// </summary> /// <param name="name">The name of the new channel.</param> /// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param> /// <param name="options">The options to be used when sending the request.</param> /// <exception cref="ArgumentNullException"><paramref name="name" /> is <c>null</c>.</exception> /// <returns> /// The created voice channel. /// </returns> public Task <RestVoiceChannel> CreateVoiceChannelAsync(string name, Action <VoiceChannelProperties> func = null, RequestOptions options = null) => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options, func);
/// <summary> /// Gets a collection of all category channels in this guild. /// </summary> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// A task that represents the asynchronous get operation. The task result contains a read-only collection of /// category channels found within this guild. /// </returns> public async Task <IReadOnlyCollection <RestCategoryChannel> > GetCategoryChannelsAsync(RequestOptions options = null) { var channels = await GuildHelper.GetChannelsAsync(this, Discord, options).ConfigureAwait(false); return(channels.OfType <RestCategoryChannel>().ToImmutableArray()); }
/// <summary> /// Gets a ban object for a banned user. /// </summary> /// <param name="userId">The snowflake identifier for the banned user.</param> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// A task that represents the asynchronous get operation. The task result contains a ban object, which /// contains the user information and the reason for the ban; <c>null</c> if the ban entry cannot be found. /// </returns> public Task <RestBan> GetBanAsync(ulong userId, RequestOptions options = null) => GuildHelper.GetBanAsync(this, Discord, userId, options);
public async Task <IReadOnlyCollection <RestVoiceChannel> > GetVoiceChannelsAsync(RequestOptions options = null) { var channels = await GuildHelper.GetChannelsAsync(this, Discord, options).ConfigureAwait(false); return(channels.Select(x => x as RestVoiceChannel).Where(x => x != null).ToImmutableArray()); }
/// <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);
public Task <RestVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null) => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options);
/// <inheritdoc /> /// <exception cref="ArgumentNullException"><paramref name="func"/> is <c>null</c>.</exception> public Task <GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action <EmoteProperties> func, RequestOptions options = null) => GuildHelper.ModifyEmoteAsync(this, Discord, emote.Id, func, options);
//Invites public Task <IReadOnlyCollection <RestInviteMetadata> > GetInvitesAsync(RequestOptions options = null) => GuildHelper.GetInvitesAsync(this, Discord, options);
/// <inheritdoc /> public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null) => GuildHelper.DeleteEmoteAsync(this, Discord, emote.Id, options);
public Task <RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null) => GuildHelper.GetUserAsync(this, Discord, id, options);
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null) => GuildHelper.AddBanAsync(this, Discord, userId, pruneDays, reason, options);
public Task <RestGuildUser> GetOwnerAsync(RequestOptions options = null) => GuildHelper.GetUserAsync(this, Discord, OwnerId, options);
public Task RemoveBanAsync(ulong userId, RequestOptions options = null) => GuildHelper.RemoveBanAsync(this, Discord, userId, options);
/// <inheritdoc /> public Task DeleteAsync(RequestOptions options = null) => GuildHelper.DeleteAsync(this, Discord, options);
public Task <RestGuildChannel> GetChannelAsync(ulong id, RequestOptions options = null) => GuildHelper.GetChannelAsync(this, Discord, id, options);
/// <inheritdoc /> /// <exception cref="ArgumentNullException"><paramref name="args" /> is <c>null</c>.</exception> public async Task ReorderChannelsAsync(IEnumerable <ReorderChannelProperties> args, RequestOptions options = null) { var arr = args.ToArray(); await GuildHelper.ReorderChannelsAsync(this, Discord, arr, options).ConfigureAwait(false); }
public async Task <RestVoiceChannel> GetVoiceChannelAsync(ulong id, RequestOptions options = null) { var channel = await GuildHelper.GetChannelAsync(this, Discord, id, options).ConfigureAwait(false); return(channel as RestVoiceChannel); }
//Bans //Bans /// <summary> /// Gets a collection of all users banned in this guild. /// </summary> /// <param name="options">The options to be used when sending the request.</param> /// <returns> /// A task that represents the asynchronous get operation. The task result contains a read-only collection of /// ban objects that this guild currently possesses, with each object containing the user banned and reason /// behind the ban. /// </returns> public Task <IReadOnlyCollection <RestBan> > GetBansAsync(RequestOptions options = null) => GuildHelper.GetBansAsync(this, Discord, options);
public async Task <RestTextChannel> GetDefaultChannelAsync(RequestOptions options = null) { var channel = await GuildHelper.GetChannelAsync(this, Discord, DefaultChannelId, options).ConfigureAwait(false); return(channel as RestTextChannel); }