Role
Implementation of a Discord Guild Role as a Luau builder.
https://discord.com/developers/docs/resources/guild#create-guild-role-json-params
Summary
Properties
Role.name :: string?Role.permissionFlags :: { apiTypes.Permissions }Role.color :: number?Role.isHoisted :: boolean?Role.icon :: string?Role.unicodeEmoji :: string?Role.isMentionable :: boolean?Properties
Section titled “Properties”The name of the role.
permissionFlags
Section titled “permissionFlags”The permissions assigned to the role.
The color of the role represented as a hexadecimal number.
isHoisted
Section titled “isHoisted”Whether the role is displayed separately in the member list.
The icon of the role.
unicodeEmoji
Section titled “unicodeEmoji”The unicode emoji of the role.
isMentionable
Section titled “isMentionable”Whether the role can be mentioned by users.
Methods
Section titled “Methods”setName
Section titled “setName”Role : setName ( roleName ) -> Role
Sets the name of the role, optionally this could be defined when creating the Role Builder as well.
Parameters
| roleName: string |
Returns
| Role |
setPermissions
Section titled “setPermissions”Role : setPermissions ( ... ) -> Role
Sets the permissions of the role, optionally this could be defined when creating the Role Builder as well.
Parameters
| ...: Permissions |
Returns
| Role |
setColor
Section titled “setColor”Role : setColor ( color ) -> Role
Sets the color of the role. Colors are presennted as a hexadecimal number.
Parameters
| color: number |
Returns
| Role |
setHoisted
Section titled “setHoisted”Role : setHoisted ( isHoisted ) -> Role
Sets the role to be hoisted. A hoisted role is displayed in the user listing, vs’s an unhoisted role which is not displayed at all.
Parameters
| isHoisted: boolean |
Returns
| Role |
setMentionable
Section titled “setMentionable”Role : setMentionable ( isMentionable ) -> Role
Sets the role to be mentionable through the @ mention.
Parameters
| isMentionable: boolean |
Returns
| Role |
Role : build ( ) -> JSON
Responsible for buillding the role object that the Discord API can understand.
Returns
| JSON |
Functions
Section titled “Functions”Role . new ( resource ) -> Role
Constructs a new Role Builder.
local role = Role.new("Role Name", { permissions.Permission.SendMessages }) :setColor(0xFFFFFF) :setHoisted(true) :setMentionable(true) :build()Parameters
| resource: { roleName: string?, rolePermissions: { apiTypes.Permissions, } |
Returns
| Role |