UNPKG

artibot

Version:

Modern, fast and modular open-source Discord bot

89 lines (88 loc) 3.4 kB
import InteractionManager from "./interactionManager.js"; import { log } from "./logger.js"; import Localizer from "artibot-localizer"; import * as discord from "discord.js"; import { ArtibotConfig } from "./config.js"; import { ContributorList, RegisterModuleOverload } from "./types.js"; import { Module } from "./modules.js"; export * from "./modules.js"; export * from "./logger.js"; export * from "./types.js"; export * from "./interactionManager.js"; export * from "./config.js"; export * from "./embed.js"; /** * Powerful Discord bot system. * @author Artivain <info@artivain.com> * @author Thomas Fournier <thomas@artivain.com> * @see https://github.com/Artivain/artibot * @see https://artibot.artivain.com * @see https://docs.artibot.artivain.com * @license GPL-3.0-or-later */ export declare class Artibot { #private; /** Localizer using the default strings for Artibot */ localizer: Localizer; /** Stores the Artibot config object */ config: ArtibotConfig; /** Version of Artibot */ version: string; /** Store cooldowns for the commands */ cooldowns: discord.Collection<string, discord.Collection<discord.Snowflake, number>>; /** Registered modules */ modules: discord.Collection<string, Module>; /** Discord.js client */ client?: discord.Client; /** Instance of {@link InteractionManager} */ interactionManager?: InteractionManager; /** Lists of people who contributed to the Artibot */ readonly contributors: ContributorList; /** * @deprecated Please directly use the exported {@link log} directly */ log: typeof log; /** * @param config - Configuration object for Artibot, use {@link ArtibotConfigBuilder} to make this easily. */ constructor(config: Partial<ArtibotConfig>); /** * Create an embed * @param data - Data to set in the embed * @returns A new embed builder, already configured with the defaults from the config */ createEmbed: (data?: discord.EmbedData) => discord.EmbedBuilder; /** * @param config - Advanced config for the bot * @param config.token - The login token for the Discord bot * @param config.additionalIntents - Additional intents to register in the Discord client * @method * @async */ readonly login: ({ token, additionalIntents }: { token: string; additionalIntents?: discord.IntentsBitField[] | undefined; }) => Promise<void>; /** * Register a module in Artibot * @param module - The module to register or a function to initialize the module * @param config - Custom configuration for the module. See module documentation to learn more. */ readonly registerModule: RegisterModuleOverload; /** * Get latest release version of a GitHub repository * @param repo - GitHub repository to get latest version * @returns Version number, or false if repo not found or an error happens */ readonly checkForUpdates: (repo?: string) => Promise<string | false>; /** * Get latest release version of a NPM package * @param packageName - Package name on NPM * @returns Version number, or false if package not found or an error happens * @method * @async */ readonly checkForPackageUpdates: (packageName?: string) => Promise<string | false>; } /** @ignore */ export default Artibot;