Skip to content

@mastondzn/dank-twitch-irc / SlowModeRateLimiter

Class: SlowModeRateLimiter

Implements

Constructors

new SlowModeRateLimiter(client, maxQueueLength)

new SlowModeRateLimiter(client, maxQueueLength): SlowModeRateLimiter

Parameters

client: ChatClient

maxQueueLength: number= 10

Returns

SlowModeRateLimiter

Source

src/mixins/ratelimiters/slow-mode.ts:19

Properties

client

private readonly client: ChatClient

Source

src/mixins/ratelimiters/slow-mode.ts:14


maxQueueLength

private readonly maxQueueLength: number

Source

src/mixins/ratelimiters/slow-mode.ts:15


runningTimers

private readonly runningTimers: Record<string, EditableTimeout> = {}

Source

src/mixins/ratelimiters/slow-mode.ts:17


semaphores

private readonly semaphores: Record<string, Sema> = {}

Source

src/mixins/ratelimiters/slow-mode.ts:16


GLOBAL_SLOW_MODE_COOLDOWN

static GLOBAL_SLOW_MODE_COOLDOWN: number = 1.5

Source

src/mixins/ratelimiters/slow-mode.ts:12

Methods

acquire()

private acquire(channelName): Promise<undefined | () => void>

Parameters

channelName: string

Returns

Promise<undefined | () => void>

Source

src/mixins/ratelimiters/slow-mode.ts:98


applyToClient()

applyToClient(client): void

Parameters

client: ChatClient

Returns

void

Implementation of

ClientMixin.applyToClient

Source

src/mixins/ratelimiters/slow-mode.ts:24


getSemaphore()

private getSemaphore(channelName): Sema

Parameters

channelName: string

Returns

Sema

Source

src/mixins/ratelimiters/slow-mode.ts:65


getSlowModeDuration()

private getSlowModeDuration(channelName): number

Parameters

channelName: string

Returns

number

Source

src/mixins/ratelimiters/slow-mode.ts:163


onRoomStateChange()

private onRoomStateChange(channelName, newState): void

Parameters

channelName: string

newState: RoomState

Returns

void

Source

src/mixins/ratelimiters/slow-mode.ts:86


onUserStateChange()

private onUserStateChange(channelName, newState): void

Parameters

channelName: string

newState: UserState

Returns

void

Source

src/mixins/ratelimiters/slow-mode.ts:75