Skip to content

AllowedMention

Implementation of discords AllowedMention object as a Luau builder.

https://discord.com/developers/docs/resources/message#allowed-mentions-object

AllowedMention.parse  :: AllowedMentionTypes }

An array of allowed mention types to parse from the content.

AllowedMention.roles  :: { string }

Array of role_ids to mention (Max size of 100).

AllowedMention.users  :: { string }

Array of user_ids to mention (Max size of 100).

AllowedMention.repliedUser  :: boolean?

For replies, whether to mention the author of the message being replied to.

AllowedMention : addUserMention ( userId )  -> AllowedMention

Add a user mention to the allowed mentions for this message.

Parameters

userId: string

Returns

AllowedMention
AllowedMention : addRoleMention ( roleId )  -> AllowedMention

Add a role mention to the allowed mentions for this message.

Parameters

roleId: string

Returns

AllowedMention
AllowedMention : setRepliedUser ( repliedUser )  -> AllowedMention

For replies, whether to mention the author of the message being replied to (default false)

Parameters

repliedUser: boolean

Returns

AllowedMention
AllowedMention : setMentionsEveryone ( mentionsEveryone )  -> AllowedMention

Controls @everyone and @here mentions

Parameters

mentionsEveryone: boolean

Returns

AllowedMention
AllowedMention : build ( )  -> JSON

Responsible for building the AllowedMention JSON that can be parsed by the Discord API.

Returns

JSON
AllowedMention . new ( resource )  -> AllowedMention

Responsible for creating a new AllowedMention.

Parameters

resource: {
{ roles: { apiTypes.Snowflake } }

Returns

AllowedMention