1.1.6 • Published 2 years ago

@kanagrou/kcommands v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

KCommands

Command handler for Discord.js

About

Handle slash commands or legacy commands in the easiest way possible.

Get Started

Install the package in your project

npm install @kanagrou/commands

Create the command handler instance in your main JavaScript file

new KCommandManager(
	client, // Discord.js Client
	{
		dir: path.join(__dirname, 'commands'),
		prefix: '.',
		guild: 'YourGuildId',
		owners: ['YourId']
	}
)

Create your command !

Example `Echo` command

export default {
	name: 'echo',
	description: 'Replies the input',
	
	slash: true,
	
	options: `message<string>[Message to echo.](required) &
		  channel<channel>[Channel to send the message in.](channeltypes:0)`
	
	listener: async ({interaction}, {message, channel}) => {
		if (channel) await channel.send(message)
		else interaction.channel.send(message)
		return "Sent!"
	}		  
}

Your good to go!

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago