Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

AmandaDiscord/CommandManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CommandManager

Written by @PapiOphidian, this module serves as a Command manager and holder for Amanda. The original source has been modified to allow for usage cases outside of Amanda and also for adaptability if the future requires it to change.

Usage

There are no typings for the Command#process method by default. If you are using TypeScript or VSCode's CheckJS, you may run into issues with it yelling at you unless you type things properly. Previous iterations were similar to:

interface Command<T extends Array<any>> {
	usage: string;
	description: string;
	aliases: Array<string>;
	category: string;
	examples?: Array<string>;
	order?: number;
	process(message: Discord.Message, args: string, extras: ...T): any;
}

The message, args and extras in the process method params were removed in favor for just a ...T which is a destructured Array of whatever you want it to be. If you want the old style of how things worked, you'd have to do something similar to this while keeping in mind that the message intent is privileged and this lib expects usage of slash commmands:

const Discord = require("discord.js");
const CommandManager = require("@amanda/commandmanager");

/** @type {CommandManager<[Discord.Message, string]>} */
const commands = new CommandManager();

Then append any other extras you want into the Array. The process is similar for TS

import Discord from "discord.js";
import CommandManager from "@amanda/commandmanager";

const commands = new CommandManager<[Discord.Message, string]>();

About

A Command manager for any Discord library

Resources

Stars

Watchers

Forks