Browse Source

Add XMLDocs

* Fix comments to comply with third-person commenting style
+ Various attributes
+ Various Command-related objects
+ Many more
pull/988/head
Hsu Still 7 years ago
parent
commit
7c60b0293b
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
31 changed files with 129 additions and 55 deletions
  1. +7
    -0
      src/Discord.Net.Commands/Attributes/CommandAttribute.cs
  2. +4
    -4
      src/Discord.Net.Commands/Attributes/Preconditions/RequireBotPermissionAttribute.cs
  3. +2
    -2
      src/Discord.Net.Commands/Attributes/Preconditions/RequireContextAttribute.cs
  4. +1
    -1
      src/Discord.Net.Commands/Attributes/Preconditions/RequireNsfwAttribute.cs
  5. +1
    -1
      src/Discord.Net.Commands/Attributes/Preconditions/RequireOwnerAttribute.cs
  6. +3
    -3
      src/Discord.Net.Commands/Attributes/Preconditions/RequireUserPermissionAttribute.cs
  7. +7
    -1
      src/Discord.Net.Commands/CommandContext.cs
  8. +2
    -0
      src/Discord.Net.Commands/CommandException.cs
  9. +3
    -1
      src/Discord.Net.Commands/CommandMatch.cs
  10. +26
    -0
      src/Discord.Net.Commands/Info/CommandInfo.cs
  11. +3
    -1
      src/Discord.Net.Commands/MultiMatchHandling.cs
  12. +4
    -1
      src/Discord.Net.Commands/Results/IResult.cs
  13. +4
    -1
      src/Discord.Net.Commands/Results/ParseResult.cs
  14. +4
    -1
      src/Discord.Net.Commands/Results/PreconditionResult.cs
  15. +5
    -1
      src/Discord.Net.Commands/Results/RuntimeResult.cs
  16. +4
    -1
      src/Discord.Net.Commands/Results/SearchResult.cs
  17. +4
    -1
      src/Discord.Net.Commands/Results/TypeReaderResult.cs
  18. +1
    -1
      src/Discord.Net.Commands/RunMode.cs
  19. +1
    -0
      src/Discord.Net.Core/CDN.cs
  20. +6
    -1
      src/Discord.Net.Core/Commands/ICommandContext.cs
  21. +5
    -5
      src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
  22. +2
    -2
      src/Discord.Net.Core/Entities/Emotes/Emoji.cs
  23. +5
    -5
      src/Discord.Net.Core/Entities/Emotes/Emote.cs
  24. +2
    -2
      src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs
  25. +2
    -2
      src/Discord.Net.Core/Entities/Guilds/GuildEmbedProperties.cs
  26. +9
    -9
      src/Discord.Net.Core/Entities/Guilds/GuildProperties.cs
  27. +1
    -0
      src/Discord.Net.Core/Entities/Messages/IAttachment.cs
  28. +4
    -4
      src/Discord.Net.Core/Entities/Messages/MessageProperties.cs
  29. +4
    -4
      src/Discord.Net.Core/Entities/Users/GuildUserProperties.cs
  30. +1
    -0
      src/Discord.Net.Core/Utils/MentionUtils.cs
  31. +2
    -0
      src/Discord.Net.Rest/Entities/Messages/Attachment.cs

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

@@ -2,10 +2,17 @@ using System;

namespace Discord.Commands
{
/// <summary> Provides the execution information for a command. </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class CommandAttribute : Attribute
{
/// <summary>
/// Specifies the text required to be recognized as a command.
/// </summary>
public string Text { get; }
/// <summary>
/// Specifies the <see cref="RunMode"/> of the command. This affects how the command is executed.
/// </summary>
public RunMode RunMode { get; set; } = RunMode.Default;

public CommandAttribute()


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

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

namespace Discord.Commands
{
/// <summary>
/// This attribute requires that the bot has a specified permission in the channel a command is invoked in.
/// This attribute 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>
/// Require that the bot account has a specified GuildPermission
/// Requires that 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>
@@ -23,7 +23,7 @@ namespace Discord.Commands
ChannelPermission = null;
}
/// <summary>
/// Require that the bot account has a specified ChannelPermission.
/// Requires that the bot account to have a specific <see cref="ChannelPermission"/>.
/// </summary>
/// <param name="permission">The ChannelPermission that the bot must have. Multiple permissions can be specified by ORing the permissions together.</param>
/// <example>


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

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

/// <summary>
/// Require that the command be invoked in a specified context.
/// This attribute requires that the command 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
@@ -21,7 +21,7 @@ namespace Discord.Commands
public ContextType Contexts { get; }

/// <summary>
/// Require that the command be invoked in a specified context.
/// Requires that the command be invoked in the specified context.
/// </summary>
/// <param name="contexts">The type of context the command can be invoked in. Multiple contexts can be specified by ORing the contexts together.</param>
/// <example>


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

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace Discord.Commands
{
/// <summary>
/// Require that the command is invoked in a channel marked NSFW
/// This attribute requires that 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>
/// Require that the command is invoked by the owner of the bot.
/// This attribute requires that 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)]


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

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;

namespace Discord.Commands
@@ -13,7 +13,7 @@ namespace Discord.Commands
public ChannelPermission? ChannelPermission { get; }

/// <summary>
/// Require that the user invoking the command has a specified GuildPermission
/// Requires that the user invoking the command 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 user must have. Multiple permissions can be specified by ORing the permissions together.</param>
@@ -23,7 +23,7 @@ namespace Discord.Commands
ChannelPermission = null;
}
/// <summary>
/// Require that the user invoking the command has a specified ChannelPermission.
/// Requires that the user invoking the command to have a specific <see cref="ChannelPermission"/>.
/// </summary>
/// <param name="permission">The ChannelPermission that the user must have. Multiple permissions can be specified by ORing the permissions together.</param>
/// <example>


+ 7
- 1
src/Discord.Net.Commands/CommandContext.cs View File

@@ -1,13 +1,19 @@
namespace Discord.Commands
namespace Discord.Commands
{
public class CommandContext : ICommandContext
{
/// <inheritdoc/>
public IDiscordClient Client { get; }
/// <inheritdoc/>
public IGuild Guild { get; }
/// <inheritdoc/>
public IMessageChannel Channel { get; }
/// <inheritdoc/>
public IUser User { get; }
/// <inheritdoc/>
public IUserMessage Message { get; }

/// <summary> Indicates whether the channel that the command is executed in is a private channel. </summary>
public bool IsPrivate => Channel is IPrivateChannel;
public CommandContext(IDiscordClient client, IUserMessage msg)


+ 2
- 0
src/Discord.Net.Commands/CommandException.cs View File

@@ -4,7 +4,9 @@ namespace Discord.Commands
{
public class CommandException : Exception
{
/// <summary> The command that caused the exception. </summary>
public CommandInfo Command { get; }
/// <summary> The command context of the exception. </summary>
public ICommandContext Context { get; }

public CommandException(CommandInfo command, ICommandContext context, Exception ex)


+ 3
- 1
src/Discord.Net.Commands/CommandMatch.cs View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
@@ -7,7 +7,9 @@ namespace Discord.Commands
{
public struct CommandMatch
{
/// <summary> The command that matches the search result. </summary>
public CommandInfo Command { get; }
/// <summary> The alias of the command. </summary>
public string Alias { get; }

public CommandMatch(CommandInfo command, string alias)


+ 26
- 0
src/Discord.Net.Commands/Info/CommandInfo.cs View File

@@ -12,6 +12,11 @@ using Microsoft.Extensions.DependencyInjection;

namespace Discord.Commands
{
/// <summary> The information of a command. </summary>
/// <remarks>
/// This object contains the information of a command.
/// This can include the module of the command, various descriptions regarding the command, and its <see cref="RunMode"/>.
/// </remarks>
[DebuggerDisplay("{Name,nq}")]
public class CommandInfo
{
@@ -21,17 +26,36 @@ namespace Discord.Commands
private readonly CommandService _commandService;
private readonly Func<ICommandContext, object[], IServiceProvider, CommandInfo, Task> _action;

/// <summary> The module that the command belongs in. </summary>
public ModuleInfo Module { get; }
/// <summary> Name of the command. If none is set, the first alias is used. </summary>
public string Name { get; }
/// <summary> Summary of the command. </summary>
/// <remarks>
/// This field returns the summary of the command.
/// Summary and remarks can be useful in help commands and various implementation that fetches details of the command for the user.
/// </remarks>
public string Summary { get; }
/// <summary> Remarks of the command. </summary>
/// <remarks>
/// This field returns the remarks of the command.
/// Summary and remarks can be useful in help commands and various implementation that fetches details of the command for the user.
/// </remarks>
public string Remarks { get; }
/// <summary> The priority of the command. This is used when there are multiple overloads of the command. </summary>
public int Priority { get; }
/// <summary> Indicates whether the command accepts a <see langword="params"/> <see cref="Type"/>[] for its parameter. </summary>
public bool HasVarArgs { get; }
/// <summary> Indicates the <see cref="RunMode"/> that is being used for the command. </summary>
public RunMode RunMode { get; }

/// <summary> List of aliases defined by the <see cref="AliasAttribute"/> of the command. </summary>
public IReadOnlyList<string> Aliases { get; }
/// <summary> List of information about the parameters of the command. </summary>
public IReadOnlyList<ParameterInfo> Parameters { get; }
/// <summary> List of preconditions defined by the <see cref="PreconditionAttribute"/> of the command. </summary>
public IReadOnlyList<PreconditionAttribute> Preconditions { get; }
/// <summary> List of attributes of the command. </summary>
public IReadOnlyList<Attribute> Attributes { get; }

internal CommandInfo(CommandBuilder builder, ModuleInfo module, CommandService service)
@@ -122,6 +146,7 @@ namespace Discord.Commands
return await CommandParser.ParseArgsAsync(this, context, _commandService._ignoreExtraArgs, services, input, 0).ConfigureAwait(false);
}

/// <summary> Executes the command with the provided context, parsed value, and service provider. </summary>
public Task<IResult> ExecuteAsync(ICommandContext context, ParseResult parseResult, IServiceProvider services)
{
if (!parseResult.IsSuccess)
@@ -145,6 +170,7 @@ namespace Discord.Commands

return ExecuteAsync(context, argList, paramList, services);
}
/// <summary> Executes the command with the provided context, argument and parameter list, and service provider. </summary>
public async Task<IResult> ExecuteAsync(ICommandContext context, IEnumerable<object> argList, IEnumerable<object> paramList, IServiceProvider services)
{
services = services ?? EmptyServiceProvider.Instance;


+ 3
- 1
src/Discord.Net.Commands/MultiMatchHandling.cs View File

@@ -1,8 +1,10 @@
namespace Discord.Commands
namespace Discord.Commands
{
public enum MultiMatchHandling
{
/// <summary> Indicates that when multiple results are found, an exception should be thrown. </summary>
Exception,
/// <summary> Indicates that when multiple results are found, the best result should be chosen. </summary>
Best
}
}

+ 4
- 1
src/Discord.Net.Commands/Results/IResult.cs View File

@@ -1,9 +1,12 @@
namespace Discord.Commands
namespace Discord.Commands
{
public interface IResult
{
/// <summary> Describes the error type that may have occurred during the operation. </summary>
CommandError? Error { get; }
/// <summary> Describes the reason for the error. </summary>
string ErrorReason { get; }
/// <summary> Indicates whether the operation was successful or not. </summary>
bool IsSuccess { get; }
}
}

+ 4
- 1
src/Discord.Net.Commands/Results/ParseResult.cs View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics;

namespace Discord.Commands
@@ -9,9 +9,12 @@ namespace Discord.Commands
public IReadOnlyList<TypeReaderResult> ArgValues { get; }
public IReadOnlyList<TypeReaderResult> ParamValues { get; }

/// <inheritdoc/>
public CommandError? Error { get; }
/// <inheritdoc/>
public string ErrorReason { get; }

/// <inheritdoc/>
public bool IsSuccess => !Error.HasValue;

private ParseResult(IReadOnlyList<TypeReaderResult> argValues, IReadOnlyList<TypeReaderResult> paramValues, CommandError? error, string errorReason)


+ 4
- 1
src/Discord.Net.Commands/Results/PreconditionResult.cs View File

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

namespace Discord.Commands
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class PreconditionResult : IResult
{
/// <inheritdoc/>
public CommandError? Error { get; }
/// <inheritdoc/>
public string ErrorReason { get; }

/// <inheritdoc/>
public bool IsSuccess => !Error.HasValue;

protected PreconditionResult(CommandError? error, string errorReason)


+ 5
- 1
src/Discord.Net.Commands/Results/RuntimeResult.cs View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
@@ -14,11 +14,15 @@ namespace Discord.Commands
Reason = reason;
}

/// <inheritdoc/>
public CommandError? Error { get; }
/// <summary> Describes the execution reason or result. </summary>
public string Reason { get; }

/// <inheritdoc/>
public bool IsSuccess => !Error.HasValue;

/// <inheritdoc/>
string IResult.ErrorReason => Reason;

public override string ToString() => Reason ?? (IsSuccess ? "Successful" : "Unsuccessful");


+ 4
- 1
src/Discord.Net.Commands/Results/SearchResult.cs View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics;

namespace Discord.Commands
@@ -9,9 +9,12 @@ namespace Discord.Commands
public string Text { get; }
public IReadOnlyList<CommandMatch> Commands { get; }

/// <inheritdoc/>
public CommandError? Error { get; }
/// <inheritdoc/>
public string ErrorReason { get; }

/// <inheritdoc/>
public bool IsSuccess => !Error.HasValue;

private SearchResult(string text, IReadOnlyList<CommandMatch> commands, CommandError? error, string errorReason)


+ 4
- 1
src/Discord.Net.Commands/Results/TypeReaderResult.cs View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
@@ -26,9 +26,12 @@ namespace Discord.Commands
{
public IReadOnlyCollection<TypeReaderValue> Values { get; }

/// <inheritdoc/>
public CommandError? Error { get; }
/// <inheritdoc/>
public string ErrorReason { get; }

/// <inheritdoc/>
public bool IsSuccess => !Error.HasValue;

private TypeReaderResult(IReadOnlyCollection<TypeReaderValue> values, CommandError? error, string errorReason)


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

@@ -3,7 +3,7 @@ namespace Discord.Commands
public enum RunMode
{
/// <summary>
/// Default behaviour set in <see cref="CommandServiceConfig"/>.
/// The default behaviour set in <see cref="CommandServiceConfig"/>.
/// </summary>
Default,
/// <summary>


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

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

namespace Discord
{
/// <summary> Contains the strings related to various Content Delievery Networks (CDNs). </summary>
public static class CDN
{
/// <summary> Returns the Discord developer application icon. </summary>


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

@@ -1,11 +1,16 @@
namespace Discord.Commands
namespace Discord.Commands
{
public interface ICommandContext
{
/// <summary> The Discord client of which the command is executed with. </summary>
IDiscordClient Client { get; }
/// <summary> The guild of which the command is executed in. </summary>
IGuild Guild { get; }
/// <summary> The channel of which the command is executed in. </summary>
IMessageChannel Channel { get; }
/// <summary> The user who executed the command. </summary>
IUser User { get; }
/// <summary> The message of which the command is interpreted from. </summary>
IUserMessage Message { get; }
}
}

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

@@ -1,7 +1,7 @@
namespace Discord
namespace Discord
{
/// <summary>
/// Modify an IGuildChannel with the specified changes.
/// Properties that are used to modify an <see cref="IGuildChannel"/> with the specified changes.
/// </summary>
/// <example>
/// <code language="c#">
@@ -14,7 +14,7 @@
public class GuildChannelProperties
{
/// <summary>
/// Set the channel to this name
/// Sets the channel to this name.
/// </summary>
/// <remarks>
/// When modifying an ITextChannel, the Name MUST be alphanumeric with dashes.
@@ -23,11 +23,11 @@
/// <exception cref="Net.HttpException">A BadRequest will be thrown if the name does not match the above RegEx.</exception>
public Optional<string> Name { get; set; }
/// <summary>
/// Move the channel to the following position. This is 0-based!
/// Moves the channel to the following position. This is 0-based!
/// </summary>
public Optional<int> Position { get; set; }
/// <summary>
/// Sets the category for this channel
/// Sets the category for this channel.
/// </summary>
public Optional<ulong?> CategoryId { get; set; }
}


+ 2
- 2
src/Discord.Net.Core/Entities/Emotes/Emoji.cs View File

@@ -1,7 +1,7 @@
namespace Discord
namespace Discord
{
/// <summary>
/// A unicode emoji
/// A unicode emoji.
/// </summary>
public class Emoji : IEmote
{


+ 5
- 5
src/Discord.Net.Core/Entities/Emotes/Emote.cs View File

@@ -1,19 +1,19 @@
using System;
using System;
using System.Globalization;

namespace Discord
{
/// <summary>
/// A custom image-based emote
/// A custom image-based emote.
/// </summary>
public class Emote : IEmote, ISnowflakeEntity
{
/// <summary>
/// The display name (tooltip) of this emote
/// The display name (tooltip) of this emote.
/// </summary>
public string Name { get; }
/// <summary>
/// The ID of this emote
/// The ID of this emote.
/// </summary>
public ulong Id { get; }
/// <summary>
@@ -50,7 +50,7 @@ namespace Discord
}

/// <summary>
/// Parse an Emote from its raw format
/// Parses an Emote from its raw format.
/// </summary>
/// <param name="text">The raw encoding of an emote; for example, &lt;:dab:277855270321782784&gt;</param>
/// <returns>An emote</returns>


+ 2
- 2
src/Discord.Net.Core/Entities/Emotes/GuildEmote.cs View File

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

namespace Discord
{
/// <summary>
/// An image-based emote that is attached to a guild
/// An image-based emote that is attached to a guild.
/// </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class GuildEmote : Emote


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

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


+ 9
- 9
src/Discord.Net.Core/Entities/Guilds/GuildProperties.cs View File

@@ -1,7 +1,7 @@
namespace Discord
namespace Discord
{
/// <summary>
/// Modify an IGuild with the specified changes
/// Properties that are used to modify an <see cref="IGuild"/> with the specified changes.
/// </summary>
/// <example>
/// <code language="c#">
@@ -17,23 +17,23 @@
{
public Optional<string> Username { get; set; }
/// <summary>
/// The name of the Guild
/// The name of the Guild.
/// </summary>
public Optional<string> Name { get; set; }
/// <summary>
/// The region for the Guild's voice connections
/// The region for the Guild's voice connections.
/// </summary>
public Optional<IVoiceRegion> Region { get; set; }
/// <summary>
/// The ID of the region for the Guild's voice connections
/// The ID of the region for the Guild's voice connections.
/// </summary>
public Optional<string> RegionId { get; set; }
/// <summary>
/// What verification level new users need to achieve before speaking
/// What verification level new users need to achieve before speaking.
/// </summary>
public Optional<VerificationLevel> VerificationLevel { get; set; }
/// <summary>
/// The default message notification state for the guild
/// The default message notification state for the guild.
/// </summary>
public Optional<DefaultMessageNotifications> DefaultMessageNotifications { get; set; }
/// <summary>
@@ -41,11 +41,11 @@
/// </summary>
public Optional<int> AfkTimeout { get; set; }
/// <summary>
/// The icon of the guild
/// The icon of the guild.
/// </summary>
public Optional<Image?> Icon { get; set; }
/// <summary>
/// The guild's splash image
/// The guild's splash image.
/// </summary>
/// <remarks>
/// The guild must be partnered for this value to have any effect.


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

@@ -1,5 +1,6 @@
namespace Discord
{
/// <summary> The interface that defines an attachment object. </summary>
public interface IAttachment
{
/// <summary> The snowflake ID of the attachment. </summary>


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

@@ -1,7 +1,7 @@
namespace Discord
namespace Discord
{
/// <summary>
/// Modify a message with the specified parameters.
/// Properties that are used to modify a message with the specified parameters.
/// </summary>
/// <remarks>
/// The content of a message can be cleared with String.Empty; if and only if an Embed is present.
@@ -23,14 +23,14 @@
public class MessageProperties
{
/// <summary>
/// The content of the message
/// The content of the message.
/// </summary>
/// <remarks>
/// This must be less than 2000 characters.
/// </remarks>
public Optional<string> Content { get; set; }
/// <summary>
/// The embed the message should display
/// The embed the message should display.
/// </summary>
public Optional<Embed> Embed { get; set; }
}


+ 4
- 4
src/Discord.Net.Core/Entities/Users/GuildUserProperties.cs View File

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

namespace Discord
{
/// <summary>
/// Modify an IGuildUser with the following parameters.
/// Properties that are used to modify an <see cref="IGuildUser"/> with the following parameters.
/// </summary>
/// <example>
/// <code language="c#">
@@ -54,14 +54,14 @@ namespace Discord
/// </remarks>
public Optional<IEnumerable<ulong>> RoleIds { get; set; }
/// <summary>
/// Move a user to a voice channel.
/// Moves a user to a voice channel.
/// </summary>
/// <remarks>
/// This user MUST already be in a Voice Channel for this to work.
/// </remarks>
public Optional<IVoiceChannel> Channel { get; set; }
/// <summary>
/// Move a user to a voice channel.
/// Moves a user to a voice channel.
/// </summary>
/// <remarks>
/// This user MUST already be in a Voice Channel for this to work.


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

@@ -4,6 +4,7 @@ using System.Text;

namespace Discord
{
/// <summary> A helper class for mention-related parsing. </summary>
public static class MentionUtils
{
private const char SanitizeChar = '\x200b';


+ 2
- 0
src/Discord.Net.Rest/Entities/Messages/Attachment.cs View File

@@ -3,6 +3,7 @@ using Model = Discord.API.Attachment;

namespace Discord
{
/// <summary> A Discord attachment. </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class Attachment : IAttachment
{
@@ -38,6 +39,7 @@ namespace Discord
model.Width.IsSpecified ? model.Width.Value : (int?)null);
}

/// <summary> Returns the filename of the attachment. </summary>
public override string ToString() => Filename;
private string DebuggerDisplay => $"{Filename} ({Size} bytes)";
}


Loading…
Cancel
Save