Table of Contents

Class AllowedMentionsProperties

Namespace
NetCord.Rest
Assembly
NetCord.dll

Defines which users and roles a message is allowed to mention.

[JsonConverter(typeof(AllowedMentionsProperties.AllowedMentionsConverter))]
public class AllowedMentionsProperties
Inheritance
AllowedMentionsProperties
Inherited Members

Constructors

AllowedMentionsProperties()

public AllowedMentionsProperties()

Properties

All

Gets an instance of AllowedMentionsProperties with all mentions allowed.

public static AllowedMentionsProperties All { get; }

Property Value

AllowedMentionsProperties

AllowedRoles

A list of mentionable role IDs. Allows all roles if set to null.

public IEnumerable<ulong>? AllowedRoles { get; set; }

Property Value

IEnumerable<ulong>

Remarks

If a role's Mentionable property is set to false, and MentionEveryone is not set, it will not be mentioned regardless.

AllowedUsers

A list of mentionable users. Allows all users if set to null.

public IEnumerable<ulong>? AllowedUsers { get; set; }

Property Value

IEnumerable<ulong>

Everyone

Allows @everyone and @here.

public bool Everyone { get; set; }

Property Value

bool

Remarks

The MentionEveryone permission is required for this.

None

Gets an instance of AllowedMentionsProperties with no mentions allowed.

public static AllowedMentionsProperties None { get; }

Property Value

AllowedMentionsProperties

ReplyMention

Allows mentioning the author of a replied-to message.

public bool ReplyMention { get; set; }

Property Value

bool

Methods

AddAllowedRoles(params IEnumerable<ulong>)

A list of mentionable role IDs. Allows all roles if set to null.

public AllowedMentionsProperties AddAllowedRoles(params IEnumerable<ulong> allowedRoles)

Parameters

allowedRoles IEnumerable<ulong>

Returns

AllowedMentionsProperties

Remarks

If a role's Mentionable property is set to false, and MentionEveryone is not set, it will not be mentioned regardless.

AddAllowedUsers(params IEnumerable<ulong>)

A list of mentionable users. Allows all users if set to null.

public AllowedMentionsProperties AddAllowedUsers(params IEnumerable<ulong> allowedUsers)

Parameters

allowedUsers IEnumerable<ulong>

Returns

AllowedMentionsProperties

WithAllowedRoles(IEnumerable<ulong>?)

A list of mentionable role IDs. Allows all roles if set to null.

public AllowedMentionsProperties WithAllowedRoles(IEnumerable<ulong>? allowedRoles)

Parameters

allowedRoles IEnumerable<ulong>

Returns

AllowedMentionsProperties

Remarks

If a role's Mentionable property is set to false, and MentionEveryone is not set, it will not be mentioned regardless.

WithAllowedUsers(IEnumerable<ulong>?)

A list of mentionable users. Allows all users if set to null.

public AllowedMentionsProperties WithAllowedUsers(IEnumerable<ulong>? allowedUsers)

Parameters

allowedUsers IEnumerable<ulong>

Returns

AllowedMentionsProperties

WithEveryone(bool)

Allows @everyone and @here.

public AllowedMentionsProperties WithEveryone(bool everyone = true)

Parameters

everyone bool

Returns

AllowedMentionsProperties

Remarks

The MentionEveryone permission is required for this.

WithReplyMention(bool)

Allows mentioning the author of a replied-to message.

public AllowedMentionsProperties WithReplyMention(bool replyMention = true)

Parameters

replyMention bool

Returns

AllowedMentionsProperties