Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/harmony/src/structures/role.ts>Role

An easy to use Discord API Library for Deno.
Go to Latest
class Role
extends SnowflakeBase
import { Role } from "https://deno.land/x/harmony@v2.6.0/src/structures/role.ts";

Represents a Guild Role

Constructors

new
Role(
client: Client,
guild: Guild,
)

Properties

color: number
guild: Guild
hoist: boolean
optional
icon: string
id: string
managed: boolean
mentionable: boolean
name: string
permissions: Permissions
position: number
optional
tags: RoleTags
optional
unicodeEmoji: string

Methods

addTo(member: Member | User | string): Promise<boolean>

Add the Role to a Member

delete(): Promise<Role | undefined>

Delete the Role

edit(options: RoleModifyPayload): Promise<Role>

Edit the Role

removeFrom(member: Member | User | string): Promise<boolean>

Remove the Role from a Member

roleIcon(format?: ImageFormats, size?: ImageSize): string | undefined

Get the icon for the role. If set, is either a URL to an icon, or a Unicode emoji.