Browse Source

Added RestTextChannel documentation

pull/1161/head
Casino Boyale 7 years ago
parent
commit
44c526298e
1 changed files with 34 additions and 1 deletions
  1. +34
    -1
      src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs

+ 34
- 1
src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs View File

@@ -49,8 +49,25 @@ namespace Discord.Rest
Update(model); Update(model);
} }


/// <summary>
/// Gets a user that is able to view this channel from the associate <paramref name="id"/>.
/// </summary>
/// <param name="id">The snowflake identifier of the user you want to get.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// An awaitable <see cref="Task"/> containing a <see cref="RestGuildUser"/>.
/// </returns>
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null) public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
=> ChannelHelper.GetUserAsync(this, Guild, Discord, id, options); => ChannelHelper.GetUserAsync(this, Guild, Discord, id, options);

/// <summary>
/// Gets the collection of users that can view this channel.
/// </summary>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// Paged collection of users. Flattening the paginated response into a collection of <see cref="RestGuildUser"/>
/// with <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> is required if you wish to access the users.
/// </returns>
public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null) public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null)
=> ChannelHelper.GetUsersAsync(this, Guild, Discord, null, null, options); => ChannelHelper.GetUsersAsync(this, Guild, Discord, null, null, options);


@@ -128,7 +145,16 @@ namespace Discord.Rest
/// <inheritdoc /> /// <inheritdoc />
public IDisposable EnterTypingState(RequestOptions options = null) public IDisposable EnterTypingState(RequestOptions options = null)
=> ChannelHelper.EnterTypingState(this, Discord, options); => ChannelHelper.EnterTypingState(this, Discord, options);

/// <summary>
/// Creates a webhook for this channel.
/// </summary>
/// <param name="name">The name you want to give the webhook.</param>
/// <param name="avatar">The avatar that you want the webook to have.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// An awaitable <see cref="Task"/> containing a <see cref="RestWebhook"/>.
/// </returns>
public Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null) public Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
=> ChannelHelper.CreateWebhookAsync(this, Discord, name, avatar, options); => ChannelHelper.CreateWebhookAsync(this, Discord, name, avatar, options);
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null) public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
@@ -136,6 +162,13 @@ namespace Discord.Rest
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null) public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
=> ChannelHelper.GetWebhooksAsync(this, Discord, options); => ChannelHelper.GetWebhooksAsync(this, Discord, options);


/// <summary>
/// Gets the parent category of this channel.
/// </summary>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// An awaitable <see cref="Task"/> containing an <see cref="ICategoryChannel"/>.
/// </returns>
public Task<ICategoryChannel> GetCategoryAsync(RequestOptions options = null) public Task<ICategoryChannel> GetCategoryAsync(RequestOptions options = null)
=> ChannelHelper.GetCategoryAsync(this, Discord, options); => ChannelHelper.GetCategoryAsync(this, Discord, options);




Loading…
Cancel
Save