UNPKG

db-discord

Version:

db-discord is a library that uses discord guilds and text channels as databases. db-discord relies on discord.js

21 lines (20 loc) 1.41 kB
/// <reference types="node" /> import * as Discord from "db-discord-discord.js"; export declare function login(token: string): Promise<Discord.Client>; export declare function httpRequest(url: string): Promise<string>; export declare function httpRequestAsBuffer(url: string): Promise<Buffer>; export declare type Regexify<T> = { [P in keyof T]: RegExp; }; export declare function recursiveSearch<T>(channel: Discord.TextChannel, searchTerm: string, testerFunction: ((obj: T) => boolean) | undefined, shouldAddFunction: ((obj: T) => boolean) | undefined, converter: (message: Discord.Message) => Promise<T>): Promise<KeyPairValue<Discord.Message, T>[]>; export declare function betterSearch<T>(channel: Discord.TextChannel, converter: (message: Discord.Message) => Promise<T>, _searchTerm: Partial<T> | string, regex?: Partial<Regexify<T>>, callback?: (message: T) => boolean): Promise<KeyPairValue<string, T>[]>; export interface KeyPairValue<K, P> { Key: K; Value: P; } export declare function flatMap<T>(arr: T[][]): T[]; export declare function GUID(): string; export declare function isAlphanumerical(str: string): boolean[]; export declare function replaceCharacters(str: string, replacers: boolean[], replacement: string): string; export declare function removeUnacceptedCharactersForDiscord(str: string): string; export declare function sleep(ms: number): Promise<{}>;