Skip to content

Watcher

Represents a watcher class that extends the ShardManager.

Extends

Constructors

new Watcher(options)

1
new Watcher(options: WatcherOptions): Watcher

Initializes a new instance of the Watcher class.

Parameters

ParameterTypeDescription
optionsWatcherOptionsThe options for the watcher.

Returns

Watcher

Overrides

ShardManager.constructor

Source

seyfert/src/common/bot/watcher.ts:27

Properties

PropertyModifierTypeDescriptionOverridesInherited from
[toStringTag]readonlystring-ShardManager.[toStringTag]ShardManager.[toStringTag]
connectQueuepublicConnectQueue-ShardManager.connectQueueShardManager.connectQueue
debugger?publicLogger-ShardManager.debuggerShardManager.debugger
loggerpublicLogger---
optionspublicMakeRequired<WatcherOptions, "token" | "intents" | "info" | "handlePayload">-ShardManager.optionsShardManager.options
rest?publicApiHandler---
sizereadonlynumberShardManager.sizeShardManager.size
worker?publicWorker---
[species]readonlyMapConstructor-ShardManager.[species]ShardManager.[species]

Accessors

concurrency

1
get concurrency(): number

Returns

number

Source

seyfert/src/websocket/discord/sharder.ts:57


latency

1
get latency(): number

Returns

number

Source

seyfert/src/websocket/discord/sharder.ts:61


remaining

1
get remaining(): number

Returns

number

Source

seyfert/src/websocket/discord/sharder.ts:53


shardEnd

1
get shardEnd(): number

Returns

number

Source

seyfert/src/websocket/discord/sharder.ts:49


shardStart

1
get shardStart(): number

Returns

number

Source

seyfert/src/websocket/discord/sharder.ts:45


totalShards

1
get totalShards(): number

Returns

number

Source

seyfert/src/websocket/discord/sharder.ts:41

Methods

[iterator]()

1
iterator: IterableIterator<[number, Shard]>

Returns an iterable of entries in the map.

Returns

IterableIterator<[number, Shard]>

Inherited from

ShardManager.[iterator]

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.iterable.d.ts:119


calculateShardId()

1
calculateShardId(guildId: string): number

Parameters

ParameterType
guildIdstring

Returns

number

Inherited from

ShardManager.calculateShardId

Source

seyfert/src/websocket/discord/sharder.ts:69


clear()

1
clear(): void

Returns

void

Inherited from

ShardManager.clear

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.collection.d.ts:20


delete()

1
delete(key: number): boolean

Parameters

ParameterType
keynumber

Returns

boolean

true if an element in the Map existed and has been removed, or false if the element does not exist.

Inherited from

ShardManager.delete

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.collection.d.ts:24


disconnect()

1
disconnect(shardId: number): undefined | Promise<void>

Parameters

ParameterType
shardIdnumber

Returns

undefined | Promise<void>

Inherited from

ShardManager.disconnect

Source

seyfert/src/websocket/discord/sharder.ts:130


disconnectAll()

1
disconnectAll(): Promise<unknown>

Returns

Promise<unknown>

Inherited from

ShardManager.disconnectAll

Source

seyfert/src/websocket/discord/sharder.ts:135


entries()

1
entries(): IterableIterator<[number, Shard]>

Returns an iterable of key, value pairs for every entry in the map.

Returns

IterableIterator<[number, Shard]>

Inherited from

ShardManager.entries

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.iterable.d.ts:124


forEach()

1
forEach(callbackfn: (value: Shard, key: number, map: Map<number, Shard>) => void, thisArg?: any): void

Executes a provided function once per each key/value pair in the Map, in insertion order.

Parameters

ParameterType
callbackfn(value: Shard, key: number, map: Map<number, Shard>) => void
thisArg?any

Returns

void

Inherited from

ShardManager.forEach

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.collection.d.ts:28


forceIdentify()

1
forceIdentify(shardId: number): Promise<void>

Parameters

ParameterType
shardIdnumber

Returns

Promise<void>

Inherited from

ShardManager.forceIdentify

Source

seyfert/src/websocket/discord/sharder.ts:125


get()

1
get(key: number): undefined | Shard

Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

Parameters

ParameterType
keynumber

Returns

undefined | Shard

Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

Inherited from

ShardManager.get

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.collection.d.ts:33


has()

1
has(key: number): boolean

Parameters

ParameterType
keynumber

Returns

boolean

boolean indicating whether an element with the specified key exists or not.

Inherited from

ShardManager.has

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.collection.d.ts:37


joinVoice()

1
joinVoice(
2
guild_id: string,
3
channel_id: string,
4
options: Object): void

Parameters

ParameterType
guild_idstring
channel_idstring
optionsObject
options.selfDeafboolean
options.selfMuteboolean

Returns

void

Inherited from

ShardManager.joinVoice

Source

seyfert/src/websocket/discord/sharder.ts:160


keys()

1
keys(): IterableIterator<number>

Returns an iterable of keys in the map

Returns

IterableIterator<number>

Inherited from

ShardManager.keys

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.iterable.d.ts:129


leaveVoice()

1
leaveVoice(guild_id: string): void

Parameters

ParameterType
guild_idstring

Returns

void

Inherited from

ShardManager.leaveVoice

Source

seyfert/src/websocket/discord/sharder.ts:178


resetWorker()

1
resetWorker(): void

Resets the worker instance.

Returns

void

Source

seyfert/src/common/bot/watcher.ts:49


send()

1
send<T>(shardId: number, payload: T): void

Type parameters

Type parameter
T extends GatewaySendPayload

Parameters

ParameterType
shardIdnumber
payloadT

Returns

void

Inherited from

ShardManager.send

Source

seyfert/src/websocket/discord/sharder.ts:193


set()

1
set(key: number, value: Shard): this

Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

Parameters

ParameterType
keynumber
valueShard

Returns

this

Inherited from

ShardManager.set

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.collection.d.ts:41


setPresence()

1
setPresence(payload: GatewayPresenceUpdateData): Promise<void>

Parameters

ParameterType
payloadGatewayPresenceUpdateData

Returns

Promise<void>

Inherited from

ShardManager.setPresence

Source

seyfert/src/websocket/discord/sharder.ts:151


setShardPresence()

1
setShardPresence(shardId: number, payload: GatewayPresenceUpdateData): void

Parameters

ParameterType
shardIdnumber
payloadGatewayPresenceUpdateData

Returns

void

Inherited from

ShardManager.setShardPresence

Source

seyfert/src/websocket/discord/sharder.ts:143


spawn()

1
spawn(shardId: number): Shard

Parameters

ParameterType
shardIdnumber

Returns

Shard

Inherited from

ShardManager.spawn

Source

seyfert/src/websocket/discord/sharder.ts:73


spawnBuckets()

1
spawnBuckets(): Shard[][]

Returns

Shard[][]

Inherited from

ShardManager.spawnBuckets

Source

seyfert/src/websocket/discord/sharder.ts:112


spawnShards()

1
spawnShards(): Promise<void>

Spawns shards for the watcher.

Returns

Promise<void>

Overrides

ShardManager.spawnShards

Source

seyfert/src/common/bot/watcher.ts:72


values()

1
values(): IterableIterator<Shard>

Returns an iterable of values in the map

Returns

IterableIterator<Shard>

Inherited from

ShardManager.values

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.iterable.d.ts:134


groupBy()

1
static groupBy<K, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Map<K, T[]>

Groups members of an iterable according to the return value of the passed callback.

Type parameters

Type parameter
K
T

Parameters

ParameterTypeDescription
itemsIterable<T>An iterable.
keySelector(item: T, index: number) => KA callback which will be invoked for each item in items.

Returns

Map<K, T[]>

Inherited from

ShardManager.groupBy

Source

node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.esnext.collection.d.ts:25