Table of Contents

Class ForumTagBuilder

Namespace
Discord
Assembly
Discord.Net.Core.dll
public class ForumTagBuilder
Inheritance
ForumTagBuilder
Inherited Members

Constructors

ForumTagBuilder()

Initializes a new ForumTagBuilder class.

public ForumTagBuilder()

ForumTagBuilder(string, ulong?, bool)

Initializes a new ForumTagBuilder class with values

public ForumTagBuilder(string name, ulong? id = null, bool isModerated = false)

Parameters

name string

Name of the tag.

id ulong?

If set existing tag will be updated or a new one will be created otherwise.

isModerated bool

Sets whether this tag can only be added to or removed from threads by a member with the ManageThreads permission.

ForumTagBuilder(string, ulong?, bool, IEmote?)

Initializes a new ForumTagBuilder class with values

public ForumTagBuilder(string name, ulong? id = null, bool isModerated = false, IEmote? emoji = null)

Parameters

name string

Name of the tag.

id ulong?

If set existing tag will be updated or a new one will be created otherwise.

isModerated bool

Sets whether this tag can only be added to or removed from threads by a member with the ManageThreads permission.

emoji IEmote

Display emoji of the tag.

ForumTagBuilder(string, ulong?, bool, ulong?)

Initializes a new ForumTagBuilder class with values

public ForumTagBuilder(string name, ulong? id = null, bool isModerated = false, ulong? emoteId = null)

Parameters

name string

Name of the tag.

id ulong?

If set existing tag will be updated or a new one will be created otherwise.

isModerated bool

Sets whether this tag can only be added to or removed from threads by a member with the ManageThreads permission

emoteId ulong?

The id of custom Display emoji of the tag.

Fields

MaxNameLength

Returns the maximum length of name allowed by Discord.

public const int MaxNameLength = 20

Field Value

int

Properties

Emoji

Gets or sets the emoji of the tag.

public IEmote? Emoji { get; set; }

Property Value

IEmote

Id

Gets or sets the snowflake Id of the tag.

public ulong? Id { get; set; }

Property Value

ulong?

Remarks

If set this will update existing tag or will create a new one otherwise.

IsModerated

Gets or sets whether this tag can only be added to or removed from threads by a member with the ManageThreads permission

public bool IsModerated { get; set; }

Property Value

bool

Name

Gets or sets the name of the tag.

public string? Name { get; set; }

Property Value

string

Exceptions

ArgumentException

Name length must be less than or equal to MaxNameLength.

Methods

Build()

Builds the Tag.

public ForumTagProperties Build()

Returns

ForumTagProperties

An instance of ForumTagProperties

Exceptions

ArgumentNullException

"Name must be set to build the tag"

Equals(ForumTagBuilder?)

Gets whether supplied tag builder is equals to the current one.

public bool Equals(ForumTagBuilder? builder)

Parameters

builder ForumTagBuilder

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

WithEmoji(IEmote?)

Sets the emoji of the tag.

public ForumTagBuilder WithEmoji(IEmote? emoji)

Parameters

emoji IEmote

Returns

ForumTagBuilder

WithId(ulong?)

Sets the id of the tag.

public ForumTagBuilder WithId(ulong? id)

Parameters

id ulong?

If set existing tag will be updated or a new one will be created otherwise.

Returns

ForumTagBuilder

Exceptions

ArgumentException

Name length must be less than or equal to MaxNameLength.

WithModerated(bool)

Sets whether this tag can only be added to or removed from threads by a member with the ManageThreads permission

public ForumTagBuilder WithModerated(bool moderated)

Parameters

moderated bool

Returns

ForumTagBuilder

WithName(string)

Sets the name of the tag.

public ForumTagBuilder WithName(string name)

Parameters

name string

Returns

ForumTagBuilder

Exceptions

ArgumentException

Name length must be less than or equal to MaxNameLength.

Operators

operator ==(ForumTagBuilder?, ForumTagBuilder?)

public static bool operator ==(ForumTagBuilder? left, ForumTagBuilder? right)

Parameters

left ForumTagBuilder
right ForumTagBuilder

Returns

bool

operator !=(ForumTagBuilder?, ForumTagBuilder?)

public static bool operator !=(ForumTagBuilder? left, ForumTagBuilder? right)

Parameters

left ForumTagBuilder
right ForumTagBuilder

Returns

bool