Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More β†’
Socket
Book a DemoInstallSign in
Socket

@luvella/firework

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luvella/firework

πŸŽ† Command framework and utilities for the Eris Discord library.

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

Firework

πŸŽ† Command framework and utilities for the Eris Discord library.

Firework is a simple, easy to use command framework for Eris. It mostly only helps you with loading, managing, etc. and leaves running the command and anything else to the user (you).

Table of Contents

Install

npm install @luvella/firework

Example

See here for an example bot.

Or...

const Firework = require('@luvella/firework');
const bot = new Firework.Client('token');

const ping = new Firework.Command(bot, {
	name: 'ping',
	aliases: ['pong']
}).executor(function ({ msg, args }) {
	msg.channel.createMessage(`Ponged ${args[0]}!`);
	// Think of `this.bot` as `bot`
	this.bot.logger.debug('ponged');
});
bot.addCommand(ping);

bot.on('messageCreate', (msg) => {
	const prefix = '!';
	if (!msg.content.startsWith(prefix)) return;

	const args = msg.content.slice(prefix.length).trim().split(' ');
	const command = args.shift().toLowerCase();

	const cmd = bot.getCommand(command); // works with the name and aliases as well
	if (!cmd) return;

	cmd.run({ msg, args });
})

License

Firework is licensed under the MIT license.
Read here for more info.

FOSSA Status

Keywords

eris

FAQs

Package last updated on 10 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts