Skip to main content

RoleToggles

@discordeno/botDocs


Documentation / @discordeno/bot / RoleToggles

Class: RoleToggles

Extends

Constructors

new RoleToggles()

new RoleToggles(roleOrTogglesInt): RoleToggles

Parameters

roleOrTogglesInt: number | DiscordRole

Returns

RoleToggles

Overrides

ToggleBitfield.constructor

Defined in

packages/bot/src/transformers/toggles/role.ts:20

Properties

bitfield

bitfield: number = 0

Inherited from

ToggleBitfield.bitfield

Defined in

packages/bot/src/transformers/toggles/ToggleBitfield.ts:2

Accessors

availableForPurchase

Get Signature

get availableForPurchase(): boolean

Whether this role is available for purchase.

Returns

boolean

Defined in

packages/bot/src/transformers/toggles/role.ts:57


guildConnections

Get Signature

get guildConnections(): boolean

Whether this is a guild's linked role.

Returns

boolean

Defined in

packages/bot/src/transformers/toggles/role.ts:62


hoist

Get Signature

get hoist(): boolean

If this role is showed separately in the user listing

Returns

boolean

Defined in

packages/bot/src/transformers/toggles/role.ts:37


managed

Get Signature

get managed(): boolean

Whether this role is managed by an integration

Returns

boolean

Defined in

packages/bot/src/transformers/toggles/role.ts:42


mentionable

Get Signature

get mentionable(): boolean

Whether this role is mentionable

Returns

boolean

Defined in

packages/bot/src/transformers/toggles/role.ts:47


premiumSubscriber

Get Signature

get premiumSubscriber(): boolean

Whether this is the guilds premium subscriber role

Returns

boolean

Defined in

packages/bot/src/transformers/toggles/role.ts:52

Methods

add()

add(bits): this

Adds some bits to the bitfield.

Parameters

bits: number

Returns

this

Inherited from

ToggleBitfield.add

Defined in

packages/bot/src/transformers/toggles/ToggleBitfield.ts:14


contains()

contains(bits): boolean

Tests whether or not this bitfield has the permission requested.

Parameters

bits: number

Returns

boolean

Inherited from

ToggleBitfield.contains

Defined in

packages/bot/src/transformers/toggles/ToggleBitfield.ts:9


has()

has(permissions): boolean

Checks whether or not the permissions exist in this

Parameters

permissions: "managed" | "hoist" | "mentionable" | "premiumSubscriber" | "availableForPurchase" | "guildConnections" | ("managed" | "hoist" | "mentionable" | "premiumSubscriber" | "availableForPurchase" | "guildConnections")[]

Returns

boolean

Defined in

packages/bot/src/transformers/toggles/role.ts:67


list()

list(): Record<"managed" | "hoist" | "mentionable" | "premiumSubscriber" | "availableForPurchase" | "guildConnections", boolean>

Lists all the toggles for the role and whether or not each is true or false.

Returns

Record<"managed" | "hoist" | "mentionable" | "premiumSubscriber" | "availableForPurchase" | "guildConnections", boolean>

Defined in

packages/bot/src/transformers/toggles/role.ts:74


remove()

remove(bits): this

Removes some bits from the bitfield.

Parameters

bits: number

Returns

this

Inherited from

ToggleBitfield.remove

Defined in

packages/bot/src/transformers/toggles/ToggleBitfield.ts:20


toJSON()

toJSON(): number

Returns

number

Inherited from

ToggleBitfield.toJSON

Defined in

packages/bot/src/transformers/toggles/ToggleBitfield.ts:25