ecstar
v5.0.0
Published
The easiest JavaScript/TypeScript Discord bot framework.
Downloads
3
Readme
📃Introduction
Ecstar is the easiest framework for Discord.js.
📖Document
🎉Features
- [x] commands
- [x] events
- [ ] slash command
- Only partially available
📥Installation
Install Ecstar
npm install ecstar
yarn add ecstar
💬Usage
*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
run({ message, send }) {
/* We will implement as usual. */
message.channel.send('pong!');
/* There is a more convenient way. */
send('pong!');
},
}));
// src/events/ready.ts
import { event } from 'ecstar';
export default event(() => ({
name: 'ready', // event name
run({ client }) {
client.log.ready(client.user?.tag);
},
}));
Run it, and it's done!