Browse Source

fix: AllowedMentions and AllowedMentionTypes (#1525)

* Give proper values to flag enum

* Add zero value

* Initialize lists

* Update xml docs
tags/2.3.0
Paulo GitHub 4 years ago
parent
commit
3325031f04
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions
  1. +13
    -3
      src/Discord.Net.Core/Entities/Messages/AllowedMentionTypes.cs
  2. +2
    -2
      src/Discord.Net.Core/Entities/Messages/AllowedMentions.cs

+ 13
- 3
src/Discord.Net.Core/Entities/Messages/AllowedMentionTypes.cs View File

@@ -8,17 +8,27 @@ namespace Discord
[Flags]
public enum AllowedMentionTypes
{
/// <summary>
/// No flag is set.
/// </summary>
/// <remarks>
/// This flag is not used to control mentions.
/// <note type="warning">
/// It will always be present and does not mean mentions will not be allowed.
/// </note>
/// </remarks>
None = 0,
/// <summary>
/// Controls role mentions.
/// </summary>
Roles,
Roles = 1,
/// <summary>
/// Controls user mentions.
/// </summary>
Users,
Users = 2,
/// <summary>
/// Controls <code>@everyone</code> and <code>@here</code> mentions.
/// </summary>
Everyone,
Everyone = 4,
}
}

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

@@ -39,7 +39,7 @@ namespace Discord
/// flag of the <see cref="AllowedTypes"/> property. If the flag is set, the value of this property
/// must be <c>null</c> or empty.
/// </summary>
public List<ulong> RoleIds { get; set; }
public List<ulong> RoleIds { get; set; } = new List<ulong>();

/// <summary>
/// Gets or sets the list of all user ids that will be mentioned.
@@ -47,7 +47,7 @@ namespace Discord
/// flag of the <see cref="AllowedTypes"/> property. If the flag is set, the value of this property
/// must be <c>null</c> or empty.
/// </summary>
public List<ulong> UserIds { get; set; }
public List<ulong> UserIds { get; set; } = new List<ulong>();

/// <summary>
/// Initializes a new instance of the <see cref="AllowedMentions"/> class.


Loading…
Cancel
Save