Esempio n. 1
0
 /// <inheritdoc />
 public Task <RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action <AddGuildUserProperties> func = null, RequestOptions options = null)
 => GuildHelper.AddGuildUserAsync(this, Discord, id, accessToken, func, options);
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
 /// <inheritdoc />
 public Task LeaveAsync(RequestOptions options = null)
 => GuildHelper.LeaveAsync(this, Discord, options);
Esempio n. 4
0
 public Task <RestGuildUser> GetCurrentUserAsync(RequestOptions options = null)
 => GuildHelper.GetUserAsync(this, Discord, Discord.CurrentUser.Id, options);
Esempio n. 5
0
 public Task <int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null)
 => GuildHelper.PruneUsersAsync(this, Discord, days, simulate, options);
Esempio n. 6
0
 public Task <RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null)
 => GuildHelper.CreateIntegrationAsync(this, Discord, id, type, options);
Esempio n. 7
0
 //Users
 public IAsyncEnumerable <IReadOnlyCollection <RestGuildUser> > GetUsersAsync(RequestOptions options = null)
 => GuildHelper.GetUsersAsync(this, Discord, null, null, options);
Esempio n. 8
0
 //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);
Esempio n. 9
0
 //Emotes
 /// <inheritdoc />
 public Task <GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
 => GuildHelper.GetEmoteAsync(this, Discord, id, options);
Esempio n. 10
0
 /// <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);
Esempio n. 11
0
 //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);
Esempio n. 12
0
 /// <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);
Esempio n. 13
0
        /// <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());
        }
Esempio n. 14
0
 /// <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);
Esempio n. 15
0
        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());
        }
Esempio n. 16
0
 /// <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);
Esempio n. 17
0
 public Task <RestVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null)
 => GuildHelper.CreateVoiceChannelAsync(this, Discord, name, options);
Esempio n. 18
0
 /// <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);
Esempio n. 19
0
 //Invites
 public Task <IReadOnlyCollection <RestInviteMetadata> > GetInvitesAsync(RequestOptions options = null)
 => GuildHelper.GetInvitesAsync(this, Discord, options);
Esempio n. 20
0
 /// <inheritdoc />
 public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
 => GuildHelper.DeleteEmoteAsync(this, Discord, emote.Id, options);
Esempio n. 21
0
 public Task <RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
 => GuildHelper.GetUserAsync(this, Discord, id, options);
Esempio n. 22
0
 public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
 => GuildHelper.AddBanAsync(this, Discord, userId, pruneDays, reason, options);
Esempio n. 23
0
 public Task <RestGuildUser> GetOwnerAsync(RequestOptions options = null)
 => GuildHelper.GetUserAsync(this, Discord, OwnerId, options);
Esempio n. 24
0
 public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
 => GuildHelper.RemoveBanAsync(this, Discord, userId, options);
Esempio n. 25
0
 /// <inheritdoc />
 public Task DeleteAsync(RequestOptions options = null)
 => GuildHelper.DeleteAsync(this, Discord, options);
Esempio n. 26
0
 public Task <RestGuildChannel> GetChannelAsync(ulong id, RequestOptions options = null)
 => GuildHelper.GetChannelAsync(this, Discord, id, options);
Esempio n. 27
0
 /// <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);
 }
Esempio n. 28
0
        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);
        }
Esempio n. 29
0
 //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);
Esempio n. 30
0
        public async Task <RestTextChannel> GetDefaultChannelAsync(RequestOptions options = null)
        {
            var channel = await GuildHelper.GetChannelAsync(this, Discord, DefaultChannelId, options).ConfigureAwait(false);

            return(channel as RestTextChannel);
        }