Skip to content

ShardManager

Extends

  • Map<number, Shard>

Constructors

new ShardManager(options)

1
new ShardManager(options: ShardManagerOptions): ShardManager

Parameters

ParameterType
optionsShardManagerOptions

Returns

ShardManager

Overrides

Map<number, Shard>.constructor

Source

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

Properties

PropertyModifierTypeDescriptionInherited from
[toStringTag]readonlystring-Map.[toStringTag]
connectQueuepublicConnectQueue--
debugger?publicLogger--
optionspublicShardManagerOptions--
sizereadonlynumberMap.size
[species]readonlyMapConstructor-Map.[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

Map.[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

Source

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


clear()

1
clear(): void

Returns

void

Inherited from

Map.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

Map.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>

Source

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


disconnectAll()

1
disconnectAll(): Promise<unknown>

Returns

Promise<unknown>

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

Map.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

Map.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>

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

Map.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

Map.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

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

Map.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

Source

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


send()

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

Type parameters

Type parameter
T extends GatewaySendPayload

Parameters

ParameterType
shardIdnumber
payloadT

Returns

void

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

Map.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>

Source

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


setShardPresence()

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

Parameters

ParameterType
shardIdnumber
payloadGatewayPresenceUpdateData

Returns

void

Source

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


spawn()

1
spawn(shardId: number): Shard

Parameters

ParameterType
shardIdnumber

Returns

Shard

Source

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


spawnBuckets()

1
spawnBuckets(): Shard[][]

Returns

Shard[][]

Source

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


spawnShards()

1
spawnShards(): Promise<void>

Returns

Promise<void>

Source

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


values()

1
values(): IterableIterator<Shard>

Returns an iterable of values in the map

Returns

IterableIterator<Shard>

Inherited from

Map.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

Map.groupBy

Source

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