Ecstar is the easiest framework Discord.js.
Install Ecstar using npm or yarn.
npm install ecstar
or
yarn add ecstar
*You can also use plain JavaScript, but TypeScript is recommended.
// src/index.ts
import { Client } from 'ecstar';
new Client({ prefix: '!' }).login(/* token */);
// src/commands/ping.ts
import { command } from 'ecstar';
export default command(() => ({
name: 'ping', // Name of the command
render({ message, send }) {
/* We will implement as usual. */
message.channel.send('pong!');
/* There is a more convenient way. */
send('pong!');
},
}));
Run it, and it's done!