Browse Source

Add XML docs

pull/1161/head
Still Hsu 7 years ago
parent
commit
a1ee83b1dc
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
8 changed files with 61 additions and 5 deletions
  1. +16
    -2
      src/Discord.Net.Core/Entities/Messages/EmbedVideo.cs
  2. +1
    -1
      src/Discord.Net.Core/Entities/Messages/IAttachment.cs
  3. +4
    -1
      src/Discord.Net.Core/Entities/Messages/IMessage.cs
  4. +7
    -1
      src/Discord.Net.Core/Entities/Messages/ReactionMetadata.cs
  5. +1
    -0
      src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs
  6. +4
    -0
      src/Discord.Net.Core/Net/HttpException.cs
  7. +21
    -0
      src/Discord.Net.Core/Net/Rest/IRestClient.cs
  8. +7
    -0
      src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs

+ 16
- 2
src/Discord.Net.Core/Entities/Messages/EmbedVideo.cs View File

@@ -11,14 +11,25 @@ namespace Discord
/// <summary>
/// Gets the URL of the video.
/// </summary>
/// <returns>
/// A string containing the URL of the image.
/// </returns>
public string Url { get; }
/// <summary>
/// Gets the height of the video, or <c>null</c> if none.
/// Gets the height of the video.
/// </summary>
/// <returns>
/// A <see cref="int"/> representing the height of this video if it can be retrieved; otherwise
/// <c>null</c>.
/// </returns>
public int? Height { get; }
/// <summary>
/// Gets the weight of the video, or <c>null</c> if none.
/// Gets the weight of the video.
/// </summary>
/// <returns>
/// A <see cref="int"/> representing the width of this video if it can be retrieved; otherwise
/// <c>null</c>.
/// </returns>
public int? Width { get; }

internal EmbedVideo(string url, int? height, int? width)
@@ -32,6 +43,9 @@ namespace Discord
/// <summary>
/// Gets the URL of the video.
/// </summary>
/// <returns>
/// A string that resolves to <see cref="Url"/>.
/// </returns>
public override string ToString() => Url;
}
}

+ 1
- 1
src/Discord.Net.Core/Entities/Messages/IAttachment.cs View File

@@ -17,7 +17,7 @@ namespace Discord
/// Gets the filename of this attachment.
/// </summary>
/// <returns>
/// A string containing the full filename of this attachment (e.g. textFile.txt).
/// A string containing the full filename of this attachment (e.g. <c>textFile.txt</c>).
/// </returns>
string Filename { get; }
/// <summary>


+ 4
- 1
src/Discord.Net.Core/Entities/Messages/IMessage.cs View File

@@ -31,8 +31,11 @@ namespace Discord
/// </returns>
bool IsPinned { get; }
/// <summary>
/// Returns the content for this message.
/// Gets the content for this message.
/// </summary>
/// <returns>
/// A string that contains the body of the message; note that this field may be empty if there is an embed.
/// </returns>
string Content { get; }
/// <summary>
/// Gets the time this message was sent.


+ 7
- 1
src/Discord.Net.Core/Entities/Messages/ReactionMetadata.cs View File

@@ -8,11 +8,17 @@ namespace Discord
/// <summary>
/// Gets the number of reactions.
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the number of this reactions that has been added to this message.
/// </returns>
public int ReactionCount { get; internal set; }

/// <summary>
/// Returns <c>true</c> if the current user has used this reaction.
/// Gets a value that indicates whether the current user has reacted to this.
/// </summary>
/// <returns>
/// <c>true</c> if the user has reacted to the message; otherwise <c>false</c>.
/// </returns>
public bool IsMe { get; internal set; }
}
}

+ 1
- 0
src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs View File

@@ -8,6 +8,7 @@ namespace Discord
public struct ChannelPermissions
{
/// <summary> Gets a blank <see cref="ChannelPermissions"/> that grants no permissions. </summary>
/// <returns>A <see cref="ChannelPermissions"/> structure that does not contain any set permissions.</returns>
public static readonly ChannelPermissions None = new ChannelPermissions();
/// <summary> Gets a <see cref="ChannelPermissions"/> that grants all permissions for text channels. </summary>
public static readonly ChannelPermissions Text = new ChannelPermissions(0b01100_0000000_1111111110001_010001);


+ 4
- 0
src/Discord.Net.Core/Net/HttpException.cs View File

@@ -38,6 +38,10 @@ namespace Discord.Net
/// <summary>
/// Initializes a new instance of the <see cref="HttpException" /> class.
/// </summary>
/// <param name="httpCode">The HTTP status code returned.</param>
/// <param name="request">The request that was sent prior to the exception.</param>
/// <param name="discordCode">The Discord status code returned.</param>
/// <param name="reason">The reason behind the exception.</param>
public HttpException(HttpStatusCode httpCode, IRequest request, int? discordCode = null, string reason = null)
: base(CreateMessage(httpCode, discordCode, reason))
{


+ 21
- 0
src/Discord.Net.Core/Net/Rest/IRestClient.cs View File

@@ -4,11 +4,32 @@ using System.Threading.Tasks;

namespace Discord.Net.Rest
{
/// <summary>
/// Represents a generic REST-based client.
/// </summary>
public interface IRestClient
{
/// <summary>
/// Sets the HTTP header of this client for all requests.
/// </summary>
/// <param name="key">The field name of the header.</param>
/// <param name="value">The value of the header.</param>
void SetHeader(string key, string value);
/// <summary>
/// Sets the cancellation token for this client.
/// </summary>
/// <param name="cancelToken">The cancellation token.</param>
void SetCancelToken(CancellationToken cancelToken);

/// <summary>
/// Sends a REST request.
/// </summary>
/// <param name="method">The method used to send this request (i.e. HTTP verb such as <c>GET</c>, <c>POST</c>).</param>
/// <param name="endpoint">The endpoint to send this request to.</param>
/// <param name="cancelToken">The cancellation token used to cancel the task.</param>
/// <param name="headerOnly">Indicates whether to send the header only.</param>
/// <param name="reason">The audit log reason.</param>
/// <returns></returns>
Task<RestResponse> SendAsync(string method, string endpoint, CancellationToken cancelToken, bool headerOnly = false, string reason = null);
Task<RestResponse> SendAsync(string method, string endpoint, string json, CancellationToken cancelToken, bool headerOnly = false, string reason = null);
Task<RestResponse> SendAsync(string method, string endpoint, IReadOnlyDictionary<string, object> multipartParams, CancellationToken cancelToken, bool headerOnly = false, string reason = null);


+ 7
- 0
src/Discord.Net.WebSocket/Entities/Users/SocketGuildUser.cs View File

@@ -66,6 +66,13 @@ namespace Discord.WebSocket
public SocketVoiceChannel VoiceChannel => VoiceState?.VoiceChannel;
/// <inheritdoc />
public string VoiceSessionId => VoiceState?.VoiceSessionId ?? "";
/// <summary>
/// Gets the voice connection status of the user if any.
/// </summary>
/// <returns>
/// A <see cref="SocketVoiceState" /> representing the user's voice status; <c>null</c> if the user is not
/// connected to a voice channel.
/// </returns>
public SocketVoiceState? VoiceState => Guild.GetVoiceState(Id);
public AudioInStream AudioStream => Guild.GetAudioStream(Id);



Loading…
Cancel
Save