@discord-types/builders/guild/role
API reference for @discord-types/builders/guild/role
@discord-types/builders/guild/role
Types
Role
Raw Type
type Role = Role.Prototype, & {
name: string?,
permissionFlags: {permissionTypes.Permissions},
color: number?,
isHoisted: boolean?,
icon: string?,
unicodeEmoji: string?,
isMentionable: boolean?
}
Intersection with variants:
Variant 2
Prop | Type | Description |
---|---|---|
name? | - | |
permissionFlags | - | |
color? | - | |
isHoisted? | - | |
icon? | - | |
unicodeEmoji? | - | |
isMentionable? | - |
JSON
Raw Type
type JSON = Role.Prototype.build(nil :: any),
Functions
Role.Prototype.setName
[[ Sets the name of the role, optionally this could be defined when creating the Role Builder as well. ]]
Function Signature
--[[
Sets the name of the role, optionally this could be defined when creating the Role Builder as well.
]]
function Role.Prototype.setName(self: Role, roleName: string) -> Role end
Arguments
roleName
Returns
ret1
Role.Prototype.setPermissions
[[ Sets the permissions of the role, optionally this could be defined when creating the Role Builder as well. ]]
Function Signature
--[[
Sets the permissions of the role, optionally this could be defined when creating the Role Builder as well.
]]
function Role.Prototype.setPermissions(self: Role, ...: permissionTypes.Permissions) -> Role end
Arguments
...
Returns
ret1
Role.Prototype.setColor
[[ Sets the color of the role. Colors are presennted as a hexadecimal number. ]]
Function Signature
--[[
Sets the color of the role. Colors are presennted as a hexadecimal number.
]]
function Role.Prototype.setColor(self: Role, color: number) -> Role end
Arguments
color
Returns
ret1
Role.Prototype.setHoisted
[[ 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. ]]
Function Signature
--[[
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.
]]
function Role.Prototype.setHoisted(self: Role, isHoisted: boolean) -> Role end
Arguments
isHoisted
Returns
ret1
Role.Prototype.setMentionable
[[ Sets the role to be mentionable through the @ mention. ]]
Function Signature
--[[
Sets the role to be mentionable through the @ mention.
]]
function Role.Prototype.setMentionable(self: Role, isMentionable: boolean) -> Role end
Arguments
isMentionable
Returns
ret1
Role.Prototype.build
[[ Responsible for buillding the role object that the Discord API can understand. ]]
Function Signature
--[[
Responsible for buillding the role object that the Discord API can understand.
]]
function Role.Prototype.build(self: Role) -> JSON end
Returns
ret1
Role.Interface.new
[[ Constructs a new Role Builder.
```lua local role = Role.new("Role Name", { permissions.Permission.SendMessages }) :setColor(0xFFFFFF) :setHoisted(true) :setMentionable(true) :build() ``` ]]
Function Signature
--[[
Constructs a new Role Builder.
\`\`\`lua
local role = Role.new("Role Name", { permissions.Permission.SendMessages })
:setColor(0xFFFFFF)
:setHoisted(true)
:setMentionable(true)
:build()
\`\`\`
]]
function Role.Interface.new(resource: {
roleName: string?,
rolePermissions: {permissionTypes.Permissions}?
}) -> Role end
Arguments
resource
Prop | Type | Description |
---|---|---|
roleName? | - | |
rolePermissions? | - |
Returns
ret1
Last updated on