Skip to content

GuildRoleBuilder

Allows a developer to build a Guild Role

local DiscordGuild = GuildRoleBuilder.new()
:setName("my-discord-role")
:setColor(0xFF0000)
:setHoisted(true)
:setMentionable(false)

Properties

The GuildRoleBuilder instance has no set properties!

Methods

setName

GuildRoleBuilder : setName (

     name: string
)  -> Objects.GuildRoleBuilder

Sets the name of the Role

setColor

GuildRoleBuilder : setColor (

     color: number
)  -> Objects.GuildRoleBuilder

Sets the color of the Role.

setHoisted

GuildRoleBuilder : setHoisted (

     hoisted: boolean
)  -> Objects.GuildRoleBuilder

Sets weather this role will split users in the roles hierarchy in the guild.

setIcon

GuildRoleBuilder : setIcon (

     imageData: string
)  -> Objects.GuildRoleBuilder

Sets the Icon for this role, the imageData should be a base64 encoded, 128x128 jpg file.

setUnicodeEmoji

GuildRoleBuilder : setUnicodeEmoji (

     unicodeEmoji: string
)  -> Objects.GuildRoleBuilder

Sets the Emoji for this Role

setPosition

GuildRoleBuilder : setPosition (

     position: number
)  -> Objects.GuildRoleBuilder

Set the position of this Role, this will update the roles hierarchy in the guild.

setMentionable

GuildRoleBuilder : setMentionable (

     mentionable: boolean
)  -> Objects.GuildRoleBuilder

Set if discord members can mention this Role.

setFlags

GuildRoleBuilder : setFlags (

     flags: number
)  -> Objects.GuildRoleBuilder

Set the flags for the Guild

toPayloadObject

GuildRoleBuilder : toPayloadObject ()  -> Network.Resolvable

Converts the role to a JSON object that can be sent to the Discord API.

Functions

new

GuildRoleBuilder . new ()  -> ()

Creates a new instance of GuildRoleBuilder.