meocord
Version:
MeoCord is a lightweight and modular framework for building scalable Discord bots using TypeScript and Discord.js. It simplifies bot development with an extensible architecture, TypeScript-first approach, and powerful CLI tools.
62 lines (61 loc) • 2.4 kB
TypeScript
/**
* MeoCord Framework
* Copyright (C) 2025 Ukasyah Rahmatullah Zada
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import 'reflect-metadata';
import { Container, type ServiceIdentifier } from 'inversify';
import { type ActivityOptions, type ClientOptions } from 'discord.js';
/** The main Inversify container for managing dependencies. */
export declare const mainContainer: Container;
/**
* `@MeoCord()` decorator for initializing and setting up the MeoCord application.
*
* @param {Object} options - The decorator options.
* @param {ServiceIdentifier[]} options.controllers - The list of controllers to be registered.
* @param {ClientOptions} options.clientOptions - The Discord client options for initializing the bot.
* @param {AppActivity[]} [options.activities] - Optional activities for the bot.
* @param {ServiceIdentifier[]} [options.services] - Optional services to be registered.
*
* @example
* ```typescript
* @MeoCord({
* controllers: [PingSlashController],
* clientOptions: {
* intents: [
* GatewayIntentBits.Guilds,
* GatewayIntentBits.GuildMembers,
* GatewayIntentBits.GuildMessages,
* GatewayIntentBits.GuildMessageReactions,
* GatewayIntentBits.MessageContent,
* ],
* partials: [Partials.Message, Partials.Channel, Partials.Reaction],
* },
* activities: [{
* name: `${sample(['Genshin', 'ZZZ'])} with Romeo`,
* type: ActivityType.Playing,
* url: 'https://enka.network/u/824957678/',
* }],
* services: [MyStandaloneService],
* })
* class MyApp {}
* ```
**/
export declare function MeoCord(options: {
controllers: ServiceIdentifier[];
clientOptions: ClientOptions;
activities?: ActivityOptions[];
services?: ServiceIdentifier[];
}): (target: any) => void;