| @@ -11,14 +11,25 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the URL of the video. | /// Gets the URL of the video. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string containing the URL of the image. | |||||
| /// </returns> | |||||
| public string Url { get; } | public string Url { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the height of the video, or <c>null</c> if none. | |||||
| /// Gets the height of the video. | |||||
| /// </summary> | /// </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; } | public int? Height { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the weight of the video, or <c>null</c> if none. | |||||
| /// Gets the weight of the video. | |||||
| /// </summary> | /// </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; } | public int? Width { get; } | ||||
| internal EmbedVideo(string url, int? height, int? width) | internal EmbedVideo(string url, int? height, int? width) | ||||
| @@ -32,6 +43,9 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the URL of the video. | /// Gets the URL of the video. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | |||||
| /// A string that resolves to <see cref="Url"/>. | |||||
| /// </returns> | |||||
| public override string ToString() => Url; | public override string ToString() => Url; | ||||
| } | } | ||||
| } | } | ||||
| @@ -17,7 +17,7 @@ namespace Discord | |||||
| /// Gets the filename of this attachment. | /// Gets the filename of this attachment. | ||||
| /// </summary> | /// </summary> | ||||
| /// <returns> | /// <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> | /// </returns> | ||||
| string Filename { get; } | string Filename { get; } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -31,8 +31,11 @@ namespace Discord | |||||
| /// </returns> | /// </returns> | ||||
| bool IsPinned { get; } | bool IsPinned { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Returns the content for this message. | |||||
| /// Gets the content for this message. | |||||
| /// </summary> | /// </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; } | string Content { get; } | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the time this message was sent. | /// Gets the time this message was sent. | ||||
| @@ -8,11 +8,17 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets the number of reactions. | /// Gets the number of reactions. | ||||
| /// </summary> | /// </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; } | public int ReactionCount { get; internal set; } | ||||
| /// <summary> | /// <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> | /// </summary> | ||||
| /// <returns> | |||||
| /// <c>true</c> if the user has reacted to the message; otherwise <c>false</c>. | |||||
| /// </returns> | |||||
| public bool IsMe { get; internal set; } | public bool IsMe { get; internal set; } | ||||
| } | } | ||||
| } | } | ||||
| @@ -8,6 +8,7 @@ namespace Discord | |||||
| public struct ChannelPermissions | public struct ChannelPermissions | ||||
| { | { | ||||
| /// <summary> Gets a blank <see cref="ChannelPermissions"/> that grants no permissions. </summary> | /// <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(); | public static readonly ChannelPermissions None = new ChannelPermissions(); | ||||
| /// <summary> Gets a <see cref="ChannelPermissions"/> that grants all permissions for text channels. </summary> | /// <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); | public static readonly ChannelPermissions Text = new ChannelPermissions(0b01100_0000000_1111111110001_010001); | ||||
| @@ -38,6 +38,10 @@ namespace Discord.Net | |||||
| /// <summary> | /// <summary> | ||||
| /// Initializes a new instance of the <see cref="HttpException" /> class. | /// Initializes a new instance of the <see cref="HttpException" /> class. | ||||
| /// </summary> | /// </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) | public HttpException(HttpStatusCode httpCode, IRequest request, int? discordCode = null, string reason = null) | ||||
| : base(CreateMessage(httpCode, discordCode, reason)) | : base(CreateMessage(httpCode, discordCode, reason)) | ||||
| { | { | ||||
| @@ -4,11 +4,32 @@ using System.Threading.Tasks; | |||||
| namespace Discord.Net.Rest | namespace Discord.Net.Rest | ||||
| { | { | ||||
| /// <summary> | |||||
| /// Represents a generic REST-based client. | |||||
| /// </summary> | |||||
| public interface IRestClient | 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); | 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); | 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, 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, 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); | Task<RestResponse> SendAsync(string method, string endpoint, IReadOnlyDictionary<string, object> multipartParams, CancellationToken cancelToken, bool headerOnly = false, string reason = null); | ||||
| @@ -66,6 +66,13 @@ namespace Discord.WebSocket | |||||
| public SocketVoiceChannel VoiceChannel => VoiceState?.VoiceChannel; | public SocketVoiceChannel VoiceChannel => VoiceState?.VoiceChannel; | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public string VoiceSessionId => VoiceState?.VoiceSessionId ?? ""; | 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 SocketVoiceState? VoiceState => Guild.GetVoiceState(Id); | ||||
| public AudioInStream AudioStream => Guild.GetAudioStream(Id); | public AudioInStream AudioStream => Guild.GetAudioStream(Id); | ||||