UNPKG

discord-bot-cli

Version:

An easy way to build a command-based discord bot with discord.js.

25 lines (24 loc) 815 B
export declare class Throttler { readonly count: number; readonly duration: number; private _current; private _timeout; /** * @param count How many time the throttler can be triggered. * @param duration Time in seconds since the first trigger before the throttler is reset. */ constructor(count: number, duration: number); /** The number of time this throttler has been triggered. */ get current(): number; /** Either or not this throttler has reached the limit. */ get throttled(): boolean; /** The time in seconds until the throttler is reset. */ get cooldown(): number; /** Resets this throttler. */ reset(): void; /** * Increment the counter. * @returns Either or not the limit has been reached. */ add(): boolean; }