Skip to content

ForumTag

Implementation of a discord forum tag object as a luau builder.

https://discord.com/developers/docs/resources/channel#forum-tag-object

ForumTag.name  :: string

The name of the tag that is displayed.

ForumTag.moderated  :: boolean

Whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission.

ForumTag.emojiId  :: string?

The id of a guild’s custom emoji.

ForumTag.emojiName  :: string?

The unicode character of the emoji.

ForumTag.id  :: string?

The id of the tag.

ForumTag : setEmoji ( emojiId emojiName )  -> ForumTag

Sets either the id of a guilds custom emoji, or a unicode character of an emoji.

Parameters

emojiId: string?
emojiName: string?

Returns

ForumTag
ForumTag : setModerated ( isModerated )  -> ForumTag

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

Parameters

isModerated: boolean

Returns

ForumTag
ForumTag : setName ( tagName )  -> ForumTag

Set the name of this Forum Tag.

Parameters

tagName: string

Returns

ForumTag
ForumTag : build ( )  -> JSON

Responsible for buillding the forum tag object that the Discord API can understand.

Returns

JSON
ForumTag . new ( resource )  -> ForumTag

Constructs a new tag builder.

local tag = ForumTag.new("tag-name")
:setModerated(true)
:build()

Parameters

resource: {
tagName: string,
emoji: { name,
id: apiTypes.Snowflake,
}

Returns

ForumTag
ForumTag . fromId ( resource )  -> ForumTag

Enables us to construct a Tag Builder object from an existing tag object, used when modifying forum tags.

Parameters

resource: {
tagId: apiTypes.Snowflake,
tagName: string,
emoji: { name,
id: apiTypes.Snowflake,
}

Returns

ForumTag