예제 #1
0
 //Channels
 public Task <IReadOnlyCollection <RestGuildChannel> > GetChannelsAsync(RequestOptions options = null)
 => GuildHelper.GetChannelsAsync(this, Discord, options);
예제 #2
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());
        }
예제 #3
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());
        }