@averagehelper/corde
Version:
A simple library for Discord bot tests. (Republished fork to demonstrate a bugfix)
35 lines (34 loc) • 1.19 kB
TypeScript
declare class UtilsManager {
private _delayValue;
/**
* Default delay value for Corde interaction with Discord.js
*/
get delayValue(): number;
/**
* Defines a delay for corde interaction with Discord data.
*
* If this interaction occur right after a message sending,
* is possible that the returned value from discord.js is not
* what is expected
*
* This is in a variable and not directly inject in the class due to
* tests purposes.
*/
setDelayValue(value: number): void;
/**
* Pick some properties of a object
*
* @see https://www.typescriptlang.org/docs/handbook/utility-types.html#picktk
* @param obj Object to get its properties
* @param keys Properties that must be got
*/
pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K>;
/**
* Creates a promise that finish after a defined time in milliseconds
* @param timeMilliseconds Time to the promise wait.
*/
wait(timeMilliseconds: number): Promise<void>;
isValuePrimitive(value: unknown): value is string | boolean | number;
}
declare const Utils: UtilsManager;
export default Utils;