Browse Source

Add XMLDocs

To many files.
pull/988/head
Hsu Still 7 years ago
parent
commit
81ad8abf59
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
69 changed files with 262 additions and 95 deletions
  1. +1
    -1
      src/Discord.Net.Commands/Attributes/CommandAttribute.cs
  2. +1
    -0
      src/Discord.Net.Commands/Attributes/DontAutoLoadAttribute.cs
  3. +1
    -0
      src/Discord.Net.Commands/Attributes/DontInjectAttribute.cs
  4. +2
    -2
      src/Discord.Net.Commands/Attributes/Preconditions/RequireBotPermissionAttribute.cs
  5. +1
    -1
      src/Discord.Net.Commands/Attributes/Preconditions/RequireContextAttribute.cs
  6. +1
    -1
      src/Discord.Net.Commands/Attributes/Preconditions/RequireNsfwAttribute.cs
  7. +1
    -1
      src/Discord.Net.Commands/Attributes/Preconditions/RequireOwnerAttribute.cs
  8. +1
    -1
      src/Discord.Net.Commands/Attributes/Preconditions/RequireUserPermissionAttribute.cs
  9. +2
    -2
      src/Discord.Net.Commands/Attributes/PriorityAttribute.cs
  10. +6
    -1
      src/Discord.Net.Core/ConnectionState.cs
  11. +5
    -7
      src/Discord.Net.Core/Entities/Activities/ActivityType.cs
  12. +3
    -0
      src/Discord.Net.Core/Entities/Activities/Game.cs
  13. +1
    -1
      src/Discord.Net.Core/Entities/Activities/GameAsset.cs
  14. +1
    -1
      src/Discord.Net.Core/Entities/Activities/GameTimestamps.cs
  15. +4
    -1
      src/Discord.Net.Core/Entities/Activities/IActivity.cs
  16. +9
    -0
      src/Discord.Net.Core/Entities/Activities/SpotifyGame.cs
  17. +5
    -2
      src/Discord.Net.Core/Entities/Activities/StreamingGame.cs
  18. +1
    -0
      src/Discord.Net.Core/Entities/CacheMode.cs
  19. +5
    -1
      src/Discord.Net.Core/Entities/Channels/Direction.cs
  20. +2
    -1
      src/Discord.Net.Core/Entities/Guilds/DefaultMessageNotifications.cs
  21. +1
    -1
      src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs
  22. +5
    -1
      src/Discord.Net.Core/Entities/Guilds/GuildIntegrationProperties.cs
  23. +2
    -1
      src/Discord.Net.Core/Entities/Guilds/MfaLevel.cs
  24. +4
    -1
      src/Discord.Net.Core/Entities/Guilds/PermissionTarget.cs
  25. +2
    -1
      src/Discord.Net.Core/Entities/Guilds/VerificationLevel.cs
  26. +2
    -1
      src/Discord.Net.Core/Entities/IDeletable.cs
  27. +2
    -1
      src/Discord.Net.Core/Entities/IMentionable.cs
  28. +1
    -0
      src/Discord.Net.Core/Entities/ISnowflakeEntity.cs
  29. +2
    -1
      src/Discord.Net.Core/Entities/IUpdateable.cs
  30. +1
    -1
      src/Discord.Net.Core/Entities/ImageFormat.cs
  31. +14
    -1
      src/Discord.Net.Core/Entities/Messages/Embed.cs
  32. +6
    -1
      src/Discord.Net.Core/Entities/Messages/EmbedAuthor.cs
  33. +2
    -4
      src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs
  34. +5
    -1
      src/Discord.Net.Core/Entities/Messages/EmbedField.cs
  35. +5
    -1
      src/Discord.Net.Core/Entities/Messages/EmbedFooter.cs
  36. +6
    -1
      src/Discord.Net.Core/Entities/Messages/EmbedImage.cs
  37. +4
    -1
      src/Discord.Net.Core/Entities/Messages/EmbedProvider.cs
  38. +6
    -1
      src/Discord.Net.Core/Entities/Messages/EmbedThumbnail.cs
  39. +10
    -0
      src/Discord.Net.Core/Entities/Messages/EmbedType.cs
  40. +5
    -1
      src/Discord.Net.Core/Entities/Messages/EmbedVideo.cs
  41. +8
    -8
      src/Discord.Net.Core/Entities/Messages/IAttachment.cs
  42. +15
    -1
      src/Discord.Net.Core/Entities/Messages/IEmbed.cs
  43. +2
    -1
      src/Discord.Net.Core/Entities/Messages/IMessage.cs
  44. +3
    -1
      src/Discord.Net.Core/Entities/Messages/IReaction.cs
  45. +2
    -1
      src/Discord.Net.Core/Entities/Messages/IUserMessage.cs
  46. +1
    -1
      src/Discord.Net.Core/Entities/Messages/MessageProperties.cs
  47. +5
    -0
      src/Discord.Net.Core/Entities/Messages/MessageSource.cs
  48. +9
    -1
      src/Discord.Net.Core/Entities/Messages/MessageType.cs
  49. +4
    -3
      src/Discord.Net.Core/Entities/Messages/ReactionMetadata.cs
  50. +10
    -2
      src/Discord.Net.Core/Entities/Messages/TagHandling.cs
  51. +8
    -1
      src/Discord.Net.Core/Entities/Messages/TagType.cs
  52. +1
    -0
      src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs
  53. +2
    -1
      src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs
  54. +5
    -1
      src/Discord.Net.Core/Entities/Permissions/PermValue.cs
  55. +1
    -0
      src/Discord.Net.Core/Entities/Roles/Color.cs
  56. +4
    -3
      src/Discord.Net.Core/Entities/Roles/ReorderRoleProperties.cs
  57. +8
    -8
      src/Discord.Net.Core/Entities/Roles/RoleProperties.cs
  58. +2
    -1
      src/Discord.Net.Core/Entities/Users/IGroupUser.cs
  59. +2
    -2
      src/Discord.Net.Core/Entities/Users/IGuildUser.cs
  60. +3
    -2
      src/Discord.Net.Core/Entities/Users/IPresence.cs
  61. +2
    -1
      src/Discord.Net.Core/Entities/Users/ISelfUser.cs
  62. +1
    -0
      src/Discord.Net.Core/Entities/Users/IUser.cs
  63. +2
    -1
      src/Discord.Net.Core/Entities/Users/IWebhookUser.cs
  64. +2
    -2
      src/Discord.Net.Core/Entities/Users/SelfUserProperties.cs
  65. +8
    -1
      src/Discord.Net.Core/Entities/Users/UserStatus.cs
  66. +6
    -6
      src/Discord.Net.Core/Entities/Webhooks/WebhookProperties.cs
  67. +1
    -0
      src/Discord.Net.Core/Logging/LogSeverity.cs
  68. +6
    -1
      src/Discord.Net.Core/LoginState.cs
  69. +1
    -0
      src/Discord.Net.Core/TokenType.cs

+ 1
- 1
src/Discord.Net.Commands/Attributes/CommandAttribute.cs View File

@@ -7,7 +7,7 @@ namespace Discord.Commands
public class CommandAttribute : Attribute
{
/// <summary>
/// Specifies the text required to be recognized as a command.
/// Gets the text that has been set to be recognized as a command.
/// </summary>
public string Text { get; }
/// <summary>


+ 1
- 0
src/Discord.Net.Commands/Attributes/DontAutoLoadAttribute.cs View File

@@ -2,6 +2,7 @@ using System;

namespace Discord.Commands
{
/// <summary> Prevents the module from being loaded automatically. </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class DontAutoLoadAttribute : Attribute
{


+ 1
- 0
src/Discord.Net.Commands/Attributes/DontInjectAttribute.cs View File

@@ -2,6 +2,7 @@ using System;

namespace Discord.Commands {

/// <summary> Prevents the property from being injected into a module. </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class DontInjectAttribute : Attribute {
}


+ 2
- 2
src/Discord.Net.Commands/Attributes/Preconditions/RequireBotPermissionAttribute.cs View File

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace Discord.Commands
{
/// <summary>
/// This attribute requires the bot to have a specific permission in the channel a command is invoked in.
/// Requires the bot to have a specific permission in the channel a command is invoked in.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequireBotPermissionAttribute : PreconditionAttribute
@@ -13,7 +13,7 @@ namespace Discord.Commands
public ChannelPermission? ChannelPermission { get; }

/// <summary>
/// Requires that the bot account to have a specific <see cref="GuildPermission"/>.
/// Requires the bot account to have a specific <see cref="GuildPermission"/>.
/// </summary>
/// <remarks>This precondition will always fail if the command is being invoked in a private channel.</remarks>
/// <param name="permission">The GuildPermission that the bot must have. Multiple permissions can be specified by ORing the permissions together.</param>


+ 1
- 1
src/Discord.Net.Commands/Attributes/Preconditions/RequireContextAttribute.cs View File

@@ -13,7 +13,7 @@ namespace Discord.Commands
}

/// <summary>
/// This attribute requires that the command be invoked in a specified context. (e.g. in guild, DM)
/// Requires the command to be invoked in a specified context. (e.g. in guild, DM)
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequireContextAttribute : PreconditionAttribute


+ 1
- 1
src/Discord.Net.Commands/Attributes/Preconditions/RequireNsfwAttribute.cs View File

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace Discord.Commands
{
/// <summary>
/// This attribute requires that the command to be invoked in a channel marked NSFW.
/// Requires the command to be invoked in a channel marked NSFW.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequireNsfwAttribute : PreconditionAttribute


+ 1
- 1
src/Discord.Net.Commands/Attributes/Preconditions/RequireOwnerAttribute.cs View File

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace Discord.Commands
{
/// <summary>
/// This attribute requires that the command to be invoked by the owner of the bot.
/// Requires the command to be invoked by the owner of the bot.
/// </summary>
/// <remarks>This precondition will only work if the bot is a bot account.</remarks>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]


+ 1
- 1
src/Discord.Net.Commands/Attributes/Preconditions/RequireUserPermissionAttribute.cs View File

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace Discord.Commands
{
/// <summary>
/// This attribute requires that the user invoking the command has a specified permission.
/// Requires the user invoking the command to have a specified permission.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class RequireUserPermissionAttribute : PreconditionAttribute


+ 2
- 2
src/Discord.Net.Commands/Attributes/PriorityAttribute.cs View File

@@ -2,11 +2,11 @@ using System;

namespace Discord.Commands
{
/// <summary> Sets priority of commands </summary>
/// <summary> Sets priority of commands. </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class PriorityAttribute : Attribute
{
/// <summary> The priority which has been set for the command </summary>
/// <summary> Gets the priority which has been set for the command. </summary>
public int Priority { get; }

/// <summary> Creates a new <see cref="PriorityAttribute"/> with the given priority. </summary>


+ 6
- 1
src/Discord.Net.Core/ConnectionState.cs View File

@@ -1,10 +1,15 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the connection state of a client. </summary>
public enum ConnectionState : byte
{
/// <summary> Represents that the client has disconnected from the WebSocket. </summary>
Disconnected,
/// <summary> Represents that the client is connecting to the WebSocket. </summary>
Connecting,
/// <summary> Represents that the client has established a connection to the WebSocket. </summary>
Connected,
/// <summary> Represents that the client is disconnecting from the WebSocket. </summary>
Disconnecting
}
}

+ 5
- 7
src/Discord.Net.Core/Entities/Activities/ActivityType.cs View File

@@ -1,17 +1,15 @@
namespace Discord
{
/// <summary>
/// Defines user's activity type.
/// </summary>
/// <summary> Specifies a Discord user's activity type. </summary>
public enum ActivityType
{
/// <summary> Activity that represents a user that is playing a game. </summary>
/// <summary> Represents that the user is playing a game. </summary>
Playing = 0,
/// <summary> Activity that represents a user that is streaming online. </summary>
/// <summary> Represents that the user is streaming online. </summary>
Streaming = 1,
/// <summary> Activity that represents a user that is listening to a song. </summary>
/// <summary> Represents that the user is listening to a song. </summary>
Listening = 2,
/// <summary> Activity that represents a user that is watching a media. </summary>
/// <summary> Represents that the user is watching a media. </summary>
Watching = 3
}
}

+ 3
- 0
src/Discord.Net.Core/Entities/Activities/Game.cs View File

@@ -2,10 +2,13 @@ using System.Diagnostics;

namespace Discord
{
/// <summary> A user's game activity. </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class Game : IActivity
{
/// <inheritdoc/>
public string Name { get; internal set; }
/// <inheritdoc/>
public ActivityType Type { get; internal set; }

internal Game() { }


+ 1
- 1
src/Discord.Net.Core/Entities/Activities/GameAsset.cs View File

@@ -1,6 +1,6 @@
namespace Discord
{
/// <summary> The asset for a <see cref="RichGame"/> object. </summary>
/// <summary> An asset for a <see cref="RichGame"/> object. </summary>
public class GameAsset
{
internal GameAsset() { }


+ 1
- 1
src/Discord.Net.Core/Entities/Activities/GameTimestamps.cs View File

@@ -2,7 +2,7 @@ using System;

namespace Discord
{
/// <summary> The timestamps for a <see cref="RichGame"/> object. </summary>
/// <summary> Timestamps for a <see cref="RichGame"/> object. </summary>
public class GameTimestamps
{
public DateTimeOffset? Start { get; }


+ 4
- 1
src/Discord.Net.Core/Entities/Activities/IActivity.cs View File

@@ -1,8 +1,11 @@
namespace Discord
namespace Discord
{
/// <summary> A Discord activity. </summary>
public interface IActivity
{
/// <summary> Gets the name of the activity. </summary>
string Name { get; }
/// <summary> Gets the type of the activity. </summary>
ActivityType Type { get; }
}
}

+ 9
- 0
src/Discord.Net.Core/Entities/Activities/SpotifyGame.cs View File

@@ -4,19 +4,28 @@ using System.Diagnostics;

namespace Discord
{
/// <summary> A user's activity for listening to a song on Spotify. </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class SpotifyGame : Game
{
/// <summary> Gets the song's artist(s). </summary>
public IEnumerable<string> Artists { get; internal set; }
/// <summary> Gets the Spotify album art for the song. </summary>
public string AlbumArt { get; internal set; }
/// <summary> Gets the Spotify album title for the song. </summary>
public string AlbumTitle { get; internal set; }
/// <summary> Gets the track title for the song. </summary>
public string TrackTitle { get; internal set; }
/// <summary> Gets the synchronization ID for the song. </summary>
public string SyncId { get; internal set; }
/// <summary> Gets the session ID for the song. </summary>
public string SessionId { get; internal set; }
/// <summary> Gets the duration for the song. </summary>
public TimeSpan? Duration { get; internal set; }

internal SpotifyGame() { }

/// <summary> Gets the name of the song. </summary>
public override string ToString() => Name;
private string DebuggerDisplay => $"{Name} (Spotify)";
}


+ 5
- 2
src/Discord.Net.Core/Entities/Activities/StreamingGame.cs View File

@@ -1,10 +1,12 @@
using System.Diagnostics;
using System.Diagnostics;

namespace Discord
{
/// <summary> A user's activity for streaming on services such as Twitch. </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class StreamingGame : Game
{
/// <summary> Gets the URL of the stream. </summary>
public string Url { get; internal set; }

public StreamingGame(string name, string url)
@@ -14,7 +16,8 @@ namespace Discord
Type = ActivityType.Streaming;
}

/// <summary> Gets the name of the stream. </summary>
public override string ToString() => Name;
private string DebuggerDisplay => $"{Name} ({Url})";
}
}
}

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

@@ -1,5 +1,6 @@
namespace Discord
{
/// <summary> Specifies the cache mode that should be used. </summary>
public enum CacheMode
{
/// <summary> Allows the object to be downloaded if it does not exist in the current cache. </summary>


+ 5
- 1
src/Discord.Net.Core/Entities/Channels/Direction.cs View File

@@ -1,9 +1,13 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the direction of where message(s) should be gotten from. </summary>
public enum Direction
{
/// <summary> The message(s) should be retrieved before a message. </summary>
Before,
/// <summary> The message(s) should be retrieved after a message. </summary>
After,
/// <summary> The message(s) should be retrieved around a message. </summary>
Around
}
}

+ 2
- 1
src/Discord.Net.Core/Entities/Guilds/DefaultMessageNotifications.cs View File

@@ -1,5 +1,6 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the default message notification behavior the guild uses. </summary>
public enum DefaultMessageNotifications
{
/// <summary> By default, all messages will trigger notifications. </summary>


+ 1
- 1
src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs View File

@@ -1,7 +1,7 @@
namespace Discord
{
/// <summary>
/// Properties that are used to modify the widget of an <see cref="IGuild"/> with the specified parameters.
/// Properties that are used to modify the widget of an <see cref="IGuild"/> with the specified changes.
/// </summary>
public class GuildEmbedProperties
{


+ 5
- 1
src/Discord.Net.Core/Entities/Guilds/GuildIntegrationProperties.cs View File

@@ -1,9 +1,13 @@
namespace Discord
namespace Discord
{
/// <summary> Properties used to modify an <see cref="IGuildIntegration"/> with the specified changes.</summary>
public class GuildIntegrationProperties
{
/// <summary> Gets or sets the behavior when an integration subscription lapses. </summary>
public Optional<int> ExpireBehavior { get; set; }
/// <summary> Gets or sets the period (in seconds) where the integration will ignore lapsed subscriptions. </summary>
public Optional<int> ExpireGracePeriod { get; set; }
/// <summary> Gets or sets whether emoticons should be synced for this integration. </summary>
public Optional<bool> EnableEmoticons { get; set; }
}
}

+ 2
- 1
src/Discord.Net.Core/Entities/Guilds/MfaLevel.cs View File

@@ -1,5 +1,6 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the guild's Multi-Factor Authentication (MFA) level requirement. </summary>
public enum MfaLevel
{
/// <summary> Users have no additional MFA restriction on this guild. </summary>


+ 4
- 1
src/Discord.Net.Core/Entities/Guilds/PermissionTarget.cs View File

@@ -1,8 +1,11 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the target of the permission. </summary>
public enum PermissionTarget
{
/// <summary> The target of the permission is a role. </summary>
Role,
/// <summary> The target of the permission is a user. </summary>
User
}
}

+ 2
- 1
src/Discord.Net.Core/Entities/Guilds/VerificationLevel.cs View File

@@ -1,5 +1,6 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the verification level the guild uses. </summary>
public enum VerificationLevel
{
/// <summary> Users have no additional restrictions on sending messages to this guild. </summary>


+ 2
- 1
src/Discord.Net.Core/Entities/IDeletable.cs View File

@@ -1,7 +1,8 @@
using System.Threading.Tasks;
using System.Threading.Tasks;

namespace Discord
{
/// <summary> Represents whether the object is deletable or not. </summary>
public interface IDeletable
{
/// <summary> Deletes this object and all its children. </summary>


+ 2
- 1
src/Discord.Net.Core/Entities/IMentionable.cs View File

@@ -1,5 +1,6 @@
namespace Discord
namespace Discord
{
/// <summary> Represents whether the object is mentionable or not. </summary>
public interface IMentionable
{
/// <summary> Returns a special string used to mention this object. </summary>


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

@@ -2,6 +2,7 @@ using System;

namespace Discord
{
/// <summary> Represents a Discord snowflake entity. </summary>
public interface ISnowflakeEntity : IEntity<ulong>
{
DateTimeOffset CreatedAt { get; }


+ 2
- 1
src/Discord.Net.Core/Entities/IUpdateable.cs View File

@@ -1,7 +1,8 @@
using System.Threading.Tasks;
using System.Threading.Tasks;

namespace Discord
{
/// <summary> Represents whether the object is updatable or not. </summary>
public interface IUpdateable
{
/// <summary> Updates this object's properties with its current state. </summary>


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

@@ -1,6 +1,6 @@
namespace Discord
{
/// <summary> The type of format for the image to return. </summary>
/// <summary> Specifies the type of format the image should return in. </summary>
public enum ImageFormat
{
Auto,


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

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
@@ -8,19 +8,32 @@ namespace Discord
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class Embed : IEmbed
{
/// <inheritdoc/>
public EmbedType Type { get; }

/// <inheritdoc/>
public string Description { get; internal set; }
/// <inheritdoc/>
public string Url { get; internal set; }
/// <inheritdoc/>
public string Title { get; internal set; }
/// <inheritdoc/>
public DateTimeOffset? Timestamp { get; internal set; }
/// <inheritdoc/>
public Color? Color { get; internal set; }
/// <inheritdoc/>
public EmbedImage? Image { get; internal set; }
/// <inheritdoc/>
public EmbedVideo? Video { get; internal set; }
/// <inheritdoc/>
public EmbedAuthor? Author { get; internal set; }
/// <inheritdoc/>
public EmbedFooter? Footer { get; internal set; }
/// <inheritdoc/>
public EmbedProvider? Provider { get; internal set; }
/// <inheritdoc/>
public EmbedThumbnail? Thumbnail { get; internal set; }
/// <inheritdoc/>
public ImmutableArray<EmbedField> Fields { get; internal set; }

internal Embed(EmbedType type)


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

@@ -1,14 +1,19 @@
using System;
using System;
using System.Diagnostics;

namespace Discord
{
/// <summary> An author field for an <see cref="Embed"/>. </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedAuthor
{
/// <summary> Gets the name of the author field.</summary>
public string Name { get; internal set; }
/// <summary> Gets the URL of the author field.</summary>
public string Url { get; internal set; }
/// <summary> Gets the icon URL of the author field.</summary>
public string IconUrl { get; internal set; }
/// <summary> Gets the proxified icon URL of the author field.</summary>
public string ProxyIconUrl { get; internal set; }

internal EmbedAuthor(string name, string url, string iconUrl, string proxyIconUrl)


+ 2
- 4
src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs View File

@@ -1,12 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;

namespace Discord
{
/// <summary>
/// Builder for creating an <see cref="Embed"/> to be sent.
/// </summary>
/// <summary> A builder for creating an <see cref="Embed"/> to be sent. </summary>
public class EmbedBuilder
{
private readonly Embed _embed;


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

@@ -1,12 +1,16 @@
using System.Diagnostics;
using System.Diagnostics;

namespace Discord
{
/// <summary> A field for an <see cref="Embed"/>. </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedField
{
/// <summary> Gets the name of the field.</summary>
public string Name { get; internal set; }
/// <summary> Gets the value of the field.</summary>
public string Value { get; internal set; }
/// <summary> Gets whether the field is inline inside an <see cref="Embed"/> or not.</summary>
public bool Inline { get; internal set; }

internal EmbedField(string name, string value, bool inline)


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

@@ -1,13 +1,17 @@
using System;
using System;
using System.Diagnostics;

namespace Discord
{
/// <summary> A footer field for an <see cref="Embed"/>. </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedFooter
{
/// <summary> Gets the text of the footer.</summary>
public string Text { get; internal set; }
/// <summary> Gets the icon URL of the footer.</summary>
public string IconUrl { get; internal set; }
/// <summary> Gets the proxified icon URL of the footer.</summary>
public string ProxyUrl { get; internal set; }

internal EmbedFooter(string text, string iconUrl, string proxyUrl)


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

@@ -1,14 +1,19 @@
using System;
using System;
using System.Diagnostics;

namespace Discord
{
/// <summary> An image for an <see cref="Embed"/>. </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedImage
{
/// <summary> Gets the URL of the image.</summary>
public string Url { get; }
/// <summary> Gets the proxified URL of the image.</summary>
public string ProxyUrl { get; }
/// <summary> Gets the height of the image if any is set. </summary>
public int? Height { get; }
/// <summary> Gets the width of the image if any is set. </summary>
public int? Width { get; }

internal EmbedImage(string url, string proxyUrl, int? height, int? width)


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

@@ -1,12 +1,15 @@
using System;
using System;
using System.Diagnostics;

namespace Discord
{
/// <summary> A provider field for an <see cref="Embed"/>. </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedProvider
{
/// <summary> Gets the name of the provider.</summary>
public string Name { get; }
/// <summary> Gets the URL of the provider.</summary>
public string Url { get; }

internal EmbedProvider(string name, string url)


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

@@ -1,14 +1,19 @@
using System;
using System;
using System.Diagnostics;

namespace Discord
{
/// <summary> A thumbnail featured in an <see cref="Embed"/>. </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedThumbnail
{
/// <summary> Gets the URL of the thumbnail.</summary>
public string Url { get; }
/// <summary> Gets the proxified URL of the thumbnail.</summary>
public string ProxyUrl { get; }
/// <summary> Gets the height of the thumbnail if any is set. </summary>
public int? Height { get; }
/// <summary> Gets the width of the thumbnail if any is set. </summary>
public int? Width { get; }

internal EmbedThumbnail(string url, string proxyUrl, int? height, int? width)


+ 10
- 0
src/Discord.Net.Core/Entities/Messages/EmbedType.cs View File

@@ -1,15 +1,25 @@
namespace Discord
{
/// <summary> Specifies the type of embed. </summary>
public enum EmbedType
{
/// <summary> An unknown embed type. </summary>
Unknown = -1,
/// <summary> A rich embed type. </summary>
Rich,
/// <summary> A link embed type. </summary>
Link,
/// <summary> A video embed type. </summary>
Video,
/// <summary> An image embed type. </summary>
Image,
/// <summary> A GIFV embed type. </summary>
Gifv,
/// <summary> An article embed type. </summary>
Article,
/// <summary> A tweet embed type. </summary>
Tweet,
/// <summary> A HTML embed type. </summary>
Html,
}
}

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

@@ -1,13 +1,17 @@
using System;
using System;
using System.Diagnostics;

namespace Discord
{
/// <summary> A video featured in an <see cref="Embed"/>. </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public struct EmbedVideo
{
/// <summary> Gets the URL of the video. </summary>
public string Url { get; }
/// <summary> Gets the height of the video if there is any. </summary>
public int? Height { get; }
/// <summary> Gets the weight of the video if there is any. </summary>
public int? Width { get; }

internal EmbedVideo(string url, int? height, int? width)


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

@@ -1,22 +1,22 @@
namespace Discord
{
/// <summary> The interface that defines an attachment object. </summary>
/// <summary> Represents a Discord attachment object. </summary>
public interface IAttachment
{
/// <summary> The snowflake ID of the attachment. </summary>
/// <summary> Gets the snowflake ID of the attachment. </summary>
ulong Id { get; }

/// <summary> The filename of the attachment. </summary>
/// <summary> Gets the filename of the attachment. </summary>
string Filename { get; }
/// <summary> The URL of the attachment. </summary>
/// <summary> Gets the URL of the attachment. </summary>
string Url { get; }
/// <summary> The proxied URL of the attachment. </summary>
/// <summary> Gets the proxied URL of the attachment. </summary>
string ProxyUrl { get; }
/// <summary> The file size of the attachment. </summary>
/// <summary> Gets the file size of the attachment. </summary>
int Size { get; }
/// <summary> The height of the attachment if it is an image, or return <see langword="null"/> when it is not. </summary>
/// <summary> Gets the height of the attachment if it is an image, or return <see langword="null"/> when it is not. </summary>
int? Height { get; }
/// <summary> The width of the attachment if it is an image, or return <see langword="null"/> when it is not. </summary>
/// <summary> Gets the width of the attachment if it is an image, or return <see langword="null"/> when it is not. </summary>
int? Width { get; }
}
}

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

@@ -1,22 +1,36 @@
using System;
using System;
using System.Collections.Immutable;

namespace Discord
{
/// <summary> Represents a Discord embed object. </summary>
public interface IEmbed
{
/// <summary> Gets the title URL of the embed. </summary>
string Url { get; }
/// <summary> Gets the title of the embed. </summary>
string Title { get; }
/// <summary> Gets the description of the embed. </summary>
string Description { get; }
/// <summary> Gets the type of the embed. </summary>
EmbedType Type { get; }
/// <summary> Gets the timestamp of the embed. </summary>
DateTimeOffset? Timestamp { get; }
/// <summary> Gets the sidebar color of the embed. </summary>
Color? Color { get; }
/// <summary> Gets the image of the embed. </summary>
EmbedImage? Image { get; }
/// <summary> Gets the video of the embed. </summary>
EmbedVideo? Video { get; }
/// <summary> Gets the author field of the embed. </summary>
EmbedAuthor? Author { get; }
/// <summary> Gets the footer field of the embed. </summary>
EmbedFooter? Footer { get; }
/// <summary> Gets the provider of the embed. </summary>
EmbedProvider? Provider { get; }
/// <summary> Gets the thumbnail featured in the embed. </summary>
EmbedThumbnail? Thumbnail { get; }
/// <summary> Gets the fields of the embed. </summary>
ImmutableArray<EmbedField> Fields { get; }
}
}

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

@@ -1,8 +1,9 @@
using System;
using System;
using System.Collections.Generic;

namespace Discord
{
/// <summary> Represents a Discord message object. </summary>
public interface IMessage : ISnowflakeEntity, IDeletable
{
/// <summary> Gets the type of this system message. </summary>


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

@@ -1,7 +1,9 @@
namespace Discord
namespace Discord
{
/// <summary> Represents a Discord reaction object. </summary>
public interface IReaction
{
/// <summary> The <see cref="IEmote"/> used in the reaction. </summary>
IEmote Emote { get; }
}
}

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

@@ -1,9 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Discord
{
/// <summary> A Discord message object. </summary>
public interface IUserMessage : IMessage
{
/// <summary> Modifies this message. </summary>


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

@@ -1,7 +1,7 @@
namespace Discord
{
/// <summary>
/// Properties that are used to modify a message with the specified parameters.
/// Properties that are used to modify an <see cref="IUserMessage"/> with the specified changes.
/// </summary>
/// <remarks>
/// The content of a message can be cleared with String.Empty; if and only if an Embed is present.


+ 5
- 0
src/Discord.Net.Core/Entities/Messages/MessageSource.cs View File

@@ -1,10 +1,15 @@
namespace Discord
{
/// <summary> Specifies the source of the Discord message. </summary>
public enum MessageSource
{
/// <summary> The message is sent by the system. </summary>
System,
/// <summary> The message is sent by a user. </summary>
User,
/// <summary> The message is sent by a bot. </summary>
Bot,
/// <summary> The message is sent by a webhook. </summary>
Webhook
}
}

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

@@ -1,13 +1,21 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the type of message. </summary>
public enum MessageType
{
/// <summary> The default message type. </summary>
Default = 0,
/// <summary> The message when a recipient is added. </summary>
RecipientAdd = 1,
/// <summary> The message when a recipient is removed. </summary>
RecipientRemove = 2,
/// <summary> The message when a user is called. </summary>
Call = 3,
/// <summary> The message when a channel name is changed. </summary>
ChannelNameChange = 4,
/// <summary> The message when a channel icon is changed. </summary>
ChannelIconChange = 5,
/// <summary> The message when another message is pinned. </summary>
ChannelPinnedMessage = 6
}
}

+ 4
- 3
src/Discord.Net.Core/Entities/Messages/ReactionMetadata.cs View File

@@ -1,11 +1,12 @@
namespace Discord
namespace Discord
{
/// <summary> A metadata containing reaction information. </summary>
public struct ReactionMetadata
{
/// <summary> Gets the number of reactions </summary>
/// <summary> Gets the number of reactions. </summary>
public int ReactionCount { get; internal set; }

/// <summary> Returns true if the current user has used this reaction </summary>
/// <summary> Returns true if the current user has used this reaction. </summary>
public bool IsMe { get; internal set; }
}
}

+ 10
- 2
src/Discord.Net.Core/Entities/Messages/TagHandling.cs View File

@@ -1,13 +1,21 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the handling type the tag should use. </summary>
public enum TagHandling
{
/// <summary> Tag handling is ignored. </summary>
Ignore = 0, //<@53905483156684800> -> <@53905483156684800>
Remove, //<@53905483156684800> ->
/// <summary> Removes the tag entirely. </summary>
Remove, //<@53905483156684800> ->
/// <summary> Resolves to username (e.g. @User). </summary>
Name, //<@53905483156684800> -> @Voltana
/// <summary> Resolves to username without mention prefix (e.g. User). </summary>
NameNoPrefix, //<@53905483156684800> -> Voltana
/// <summary> Resolves to username with discriminator value. (e.g. @User#0001). </summary>
FullName, //<@53905483156684800> -> @Voltana#8252
/// <summary> Resolves to username with discriminator value without mention prefix. (e.g. User#0001). </summary>
FullNameNoPrefix, //<@53905483156684800> -> Voltana#8252
/// <summary> Sanitizes the tag. </summary>
Sanitize //<@53905483156684800> -> <@53905483156684800> (w/ nbsp)
}
}

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

@@ -1,12 +1,19 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the type of Discord tag. </summary>
public enum TagType
{
/// <summary> The object is an user mention. </summary>
UserMention,
/// <summary> The object is a channel mention. </summary>
ChannelMention,
/// <summary> The object is a role mention. </summary>
RoleMention,
/// <summary> The object is an everyone mention. </summary>
EveryoneMention,
/// <summary> The object is a here mention. </summary>
HereMention,
/// <summary> The object is an emoji. </summary>
Emoji
}
}

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

@@ -2,6 +2,7 @@ using System;

namespace Discord
{
/// <summary> Defines the available permissions for a channel. </summary>
[FlagsAttribute]
public enum ChannelPermission : ulong
{


+ 2
- 1
src/Discord.Net.Core/Entities/Permissions/GuildPermission.cs View File

@@ -1,7 +1,8 @@
using System;
using System;

namespace Discord
{
/// <summary> Defines the available permissions for a channel. </summary>
[FlagsAttribute]
public enum GuildPermission : ulong
{


+ 5
- 1
src/Discord.Net.Core/Entities/Permissions/PermValue.cs View File

@@ -1,9 +1,13 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the permission value. </summary>
public enum PermValue
{
/// <summary> Allows this permission. </summary>
Allow,
/// <summary> Denies this permission. </summary>
Deny,
/// <summary> Inherits the permission settings. </summary>
Inherit
}
}

+ 1
- 0
src/Discord.Net.Core/Entities/Roles/Color.cs View File

@@ -3,6 +3,7 @@ using System.Diagnostics;

namespace Discord
{
/// <summary> A color object that Discord uses. </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct Color
{


+ 4
- 3
src/Discord.Net.Core/Entities/Roles/ReorderRoleProperties.cs View File

@@ -1,10 +1,11 @@
namespace Discord
namespace Discord
{
/// <summary> Properties that are used to reorder an <see cref="IRole"/>. </summary>
public class ReorderRoleProperties
{
/// <summary>The id of the role to be edited</summary>
/// <summary> Gets the ID of the role to be edited. </summary>
public ulong Id { get; }
/// <summary>The new zero-based position of the role.</summary>
/// <summary> Gets the new zero-based position of the role. </summary>
public int Position { get; }

public ReorderRoleProperties(ulong id, int pos)


+ 8
- 8
src/Discord.Net.Core/Entities/Roles/RoleProperties.cs View File

@@ -1,7 +1,7 @@
namespace Discord
namespace Discord
{
/// <summary>
/// Modify an IRole with the specified parameters
/// Properties that are used to modify an <see cref="IRole"/> with the specified changes.
/// </summary>
/// <example>
/// <code language="c#">
@@ -16,39 +16,39 @@
public class RoleProperties
{
/// <summary>
/// The name of the role
/// Gets or sets the name of the role.
/// </summary>
/// <remarks>
/// If this role is the EveryoneRole, this value may not be set.
/// </remarks>
public Optional<string> Name { get; set; }
/// <summary>
/// The role's GuildPermissions
/// Gets or sets the role's <see cref="GuildPermission"/>.
/// </summary>
public Optional<GuildPermissions> Permissions { get; set; }
/// <summary>
/// The position of the role. This is 0-based!
/// Gets or sets the position of the role. This is 0-based!
/// </summary>
/// <remarks>
/// If this role is the EveryoneRole, this value may not be set.
/// </remarks>
public Optional<int> Position { get; set; }
/// <summary>
/// The color of the Role.
/// Gets or sets the color of the Role.
/// </summary>
/// <remarks>
/// If this role is the EveryoneRole, this value may not be set.
/// </remarks>
public Optional<Color> Color { get; set; }
/// <summary>
/// Whether or not this role should be displayed independently in the userlist.
/// Gets or sets whether or not this role should be displayed independently in the userlist.
/// </summary>
/// <remarks>
/// If this role is the EveryoneRole, this value may not be set.
/// </remarks>
public Optional<bool> Hoist { get; set; }
/// <summary>
/// Whether or not this role can be mentioned.
/// Gets or sets whether or not this role can be mentioned.
/// </summary>
/// <remarks>
/// If this role is the EveryoneRole, this value may not be set.


+ 2
- 1
src/Discord.Net.Core/Entities/Users/IGroupUser.cs View File

@@ -1,5 +1,6 @@
namespace Discord
namespace Discord
{
/// <summary> Represents a Discord user that is in a group. </summary>
public interface IGroupUser : IUser, IVoiceState
{
///// <summary> Kicks this user from this group. </summary>


+ 2
- 2
src/Discord.Net.Core/Entities/Users/IGuildUser.cs View File

@@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Discord
{
/// <summary> A Guild-User pairing. </summary>
/// <summary> Represents a Discord user that is in a guild. </summary>
public interface IGuildUser : IUser, IVoiceState
{
/// <summary> Gets when this user joined this guild. </summary>


+ 3
- 2
src/Discord.Net.Core/Entities/Users/IPresence.cs View File

@@ -1,5 +1,6 @@
namespace Discord
namespace Discord
{
/// <summary> Represents a Discord user's presence status. </summary>
public interface IPresence
{
/// <summary> Gets the activity this user is currently doing. </summary>
@@ -7,4 +8,4 @@
/// <summary> Gets the current status of this user. </summary>
UserStatus Status { get; }
}
}
}

+ 2
- 1
src/Discord.Net.Core/Entities/Users/ISelfUser.cs View File

@@ -3,6 +3,7 @@ using System.Threading.Tasks;

namespace Discord
{
/// <summary> Represents a logged-in Discord user. </summary>
public interface ISelfUser : IUser
{
/// <summary> Gets the email associated with this user. </summary>
@@ -14,4 +15,4 @@ namespace Discord

Task ModifyAsync(Action<SelfUserProperties> func, RequestOptions options = null);
}
}
}

+ 1
- 0
src/Discord.Net.Core/Entities/Users/IUser.cs View File

@@ -2,6 +2,7 @@ using System.Threading.Tasks;

namespace Discord
{
/// <summary> Represents a Discord user. </summary>
public interface IUser : ISnowflakeEntity, IMentionable, IPresence
{
/// <summary> Gets the id of this user's avatar. </summary>


+ 2
- 1
src/Discord.Net.Core/Entities/Users/IWebhookUser.cs View File

@@ -1,5 +1,6 @@
namespace Discord
namespace Discord
{
/// <summary> Represents a Webhook Discord user. </summary>
public interface IWebhookUser : IGuildUser
{
ulong WebhookId { get; }


+ 2
- 2
src/Discord.Net.Core/Entities/Users/SelfUserProperties.cs View File

@@ -1,7 +1,7 @@
namespace Discord
namespace Discord
{
/// <summary>
/// Modify the current user with the specified arguments
/// Properties that are used to modify the <see cref="ISelfUser"/> with the specified changes.
/// </summary>
/// <example>
/// <code language="c#">


+ 8
- 1
src/Discord.Net.Core/Entities/Users/UserStatus.cs View File

@@ -1,12 +1,19 @@
namespace Discord
namespace Discord
{
/// <summary> Defines the available Discord user status. </summary>
public enum UserStatus
{
/// <summary> The user is offline. </summary>
Offline,
/// <summary> The user is online. </summary>
Online,
/// <summary> The user is idle. </summary>
Idle,
/// <summary> The user is AFK. </summary>
AFK,
/// <summary> The user is busy. </summary>
DoNotDisturb,
/// <summary> The user is invisible. </summary>
Invisible,
}
}

+ 6
- 6
src/Discord.Net.Core/Entities/Webhooks/WebhookProperties.cs View File

@@ -1,7 +1,7 @@
namespace Discord
namespace Discord
{
/// <summary>
/// Modify an <see cref="IWebhook"/> with the specified parameters.
/// Properties used to modify an <see cref="IWebhook"/> with the specified changes.
/// </summary>
/// <example>
/// <code language="c#">
@@ -16,22 +16,22 @@
public class WebhookProperties
{
/// <summary>
/// The default name of the webhook.
/// Gets or sets the default name of the webhook.
/// </summary>
public Optional<string> Name { get; set; }
/// <summary>
/// The default avatar of the webhook.
/// Gets or sets the default avatar of the webhook.
/// </summary>
public Optional<Image?> Image { get; set; }
/// <summary>
/// The channel for this webhook.
/// Gets or sets the channel for this webhook.
/// </summary>
/// <remarks>
/// This field is not used when authenticated with <see cref="TokenType.Webhook"/>.
/// </remarks>
public Optional<ITextChannel> Channel { get; set; }
/// <summary>
/// The channel id for this webhook.
/// Gets or sets the channel ID for this webhook.
/// </summary>
/// <remarks>
/// This field is not used when authenticated with <see cref="TokenType.Webhook"/>.


+ 1
- 0
src/Discord.Net.Core/Logging/LogSeverity.cs View File

@@ -1,5 +1,6 @@
namespace Discord
{
/// <summary> Specifies the severity of the log message. </summary>
public enum LogSeverity
{
/// <summary>


+ 6
- 1
src/Discord.Net.Core/LoginState.cs View File

@@ -1,10 +1,15 @@
namespace Discord
namespace Discord
{
/// <summary> Specifies the state of the client's login status. </summary>
public enum LoginState : byte
{
/// <summary> The client is currently logged out. </summary>
LoggedOut,
/// <summary> The client is currently logging in. </summary>
LoggingIn,
/// <summary> The client is currently logged in. </summary>
LoggedIn,
/// <summary> The client is currently logging out. </summary>
LoggingOut
}
}

+ 1
- 0
src/Discord.Net.Core/TokenType.cs View File

@@ -2,6 +2,7 @@ using System;

namespace Discord
{
/// <summary> Specifies the type of token to use with the client. </summary>
public enum TokenType
{
[Obsolete("User logins are deprecated and may result in a ToS strike against your account - please see https://github.com/RogueException/Discord.Net/issues/827", error: true)]


Loading…
Cancel
Save