Skip to main content
Defined in: gates/accessList.ts:209 bot.whitelist — an AccessList plus a mode switch. While disabled (the default) its entries have no effect. While enabled, only messages whose senderId OR chatId is on the list are processed; an enabled, empty whitelist blocks everyone. The blacklist always wins over the whitelist.

Extends

Constructors

Constructor

Defined in: gates/accessList.ts:212

Returns

Whitelist

Overrides

AccessList.constructor

Properties

name

Defined in: gates/accessList.ts:119

Inherited from

AccessList.name

Methods

add()

Defined in: gates/accessList.ts:122 Add one id or many. Duplicates are ignored. Throws TypeError on an empty/non-string id.

Parameters

Returns

this

Inherited from

AccessList.add

remove()

Defined in: gates/accessList.ts:134 Remove one id or many. Unknown ids are ignored. Throws TypeError on an empty/non-string id.

Parameters

Returns

this

Inherited from

AccessList.remove

has()

Defined in: gates/accessList.ts:144 Is id on the list? Exact, case-sensitive match. Never throws.

Parameters

Returns

boolean

Inherited from

AccessList.has

list()

Defined in: gates/accessList.ts:149 The ids on the list, in insertion order (a copy).

Returns

string[]

Inherited from

AccessList.list

clear()

Defined in: gates/accessList.ts:159 Remove every id.

Returns

this

Inherited from

AccessList.clear

onChange()

Defined in: gates/accessList.ts:188 Subscribe to effective mutations (no-op calls do not notify). Returns an unsubscriber. A throwing listener never breaks the mutation that triggered it.

Parameters

Returns

() => void

Inherited from

AccessList.onChange

enable()

Defined in: gates/accessList.ts:220 Turn whitelist mode on.

Returns

this

disable()

Defined in: gates/accessList.ts:229 Turn whitelist mode off (open access, subject to the blacklist).

Returns

this

load()

Defined in: gates/accessList.ts:241 Replace the contents from a snapshot. A bare id array, or a snapshot without enabled, leaves the current mode untouched.

Parameters

Returns

this

Overrides

AccessList.load

export()

Defined in: gates/accessList.ts:249 JSON-serializable snapshot for host-side persistence.

Returns

WhitelistSnapshot

Overrides

AccessList.export

Accessors

size

Get Signature

Defined in: gates/accessList.ts:154 Number of ids on the list.
Returns
number

Inherited from

AccessList.size

enabled

Get Signature

Defined in: gates/accessList.ts:215 Is whitelist mode active?
Returns
boolean