AllowedMention
Implementation of discords AllowedMention object as a Luau builder.
https://discord.com/developers/docs/resources/message#allowed-mentions-object
Summary
Properties
AllowedMention.parse :: { apiTypes.AllowedMentionTypes }AllowedMention.roles :: { string }AllowedMention.users :: { string }AllowedMention.repliedUser :: boolean?Methods
AllowedMention:addUserMention(userId: string) → AllowedMentionAllowedMention:addRoleMention(roleId: string) → AllowedMentionAllowedMention:setRepliedUser(repliedUser: boolean) → AllowedMentionAllowedMention:setMentionsEveryone(mentionsEveryone: boolean) → AllowedMentionAllowedMention:build() → JSONProperties
Section titled “Properties”An array of allowed mention types to parse from the content.
Array of role_ids to mention (Max size of 100).
Array of user_ids to mention (Max size of 100).
repliedUser
Section titled “repliedUser”For replies, whether to mention the author of the message being replied to.
Methods
Section titled “Methods”addUserMention
Section titled “addUserMention”AllowedMention : addUserMention ( userId ) -> AllowedMention
Add a user mention to the allowed mentions for this message.
Parameters
| userId: string |
Returns
| AllowedMention |
addRoleMention
Section titled “addRoleMention”AllowedMention : addRoleMention ( roleId ) -> AllowedMention
Add a role mention to the allowed mentions for this message.
Parameters
| roleId: string |
Returns
| AllowedMention |
setRepliedUser
Section titled “setRepliedUser”AllowedMention : setRepliedUser ( repliedUser ) -> AllowedMention
For replies, whether to mention the author of the message being replied to (default false)
Parameters
| repliedUser: boolean |
Returns
| AllowedMention |
setMentionsEveryone
Section titled “setMentionsEveryone”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 |
Functions
Section titled “Functions”AllowedMention . new ( resource ) -> AllowedMention
Responsible for creating a new AllowedMention.
Parameters
| resource: { { roles: { apiTypes.Snowflake } } |
Returns
| AllowedMention |