Skip to content

Role

Implementation of a Discord Guild Role as a Luau builder.

https://discord.com/developers/docs/resources/guild#create-guild-role-json-params

Properties

The Role instance has no set properties!

Methods

The Role instance has no set methods!

Functions

setName

Role . setName (

     self: Role
     roleName: string
)  -> ()

Sets the name of the role, optionally this could be defined when creating the Role Builder as well.

setPermissions

Role . setPermissions (

     self: Role
     ...: apiTypes.Permissions
)  -> ()

Sets the permissions of the role, optionally this could be defined when creating the Role Builder as well.

setColor

Role . setColor (

     self: Role
     color: number
)  -> ()

Sets the color of the role. Colors are presennted as a hexadecimal number.

setHoisted

Role . setHoisted (

     self: Role
     isHoisted: boolean
)  -> ()

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.

setMentionable

Role . setMentionable (

     self: Role
     isMentionable: boolean
)  -> ()

Sets the role to be mentionable through the @ mention.

build

Role . build (

     self: Role
)  -> ()

Responsible for buillding the role object that the Discord API can understand.

new

Role . new (

     resource: {
       roleName: string?,
       rolePermissions: { apiTypes.Permissions,
    }
)  -> ()

Constructs a new Role Builder.

local role = Role.new("Role Name", { permissions.Permission.SendMessages })
:setColor(0xFFFFFF)
:setHoisted(true)
:setMentionable(true)
:build()