README
Features
- @skyra/editable-commands is a framework agnostic implementation of editable commands for discord.js v13.
- Supports CommonJS and ES Modules.
Installation
You can use the following command to install this package, or replace npm install
with your package manager of choice.
npm install @skyra/editable-commands
Usage
JavaScript
Without a framework
const { send } = require('@skyra/editable-commands');
client.on('messageCreate', (message) => {
send(message, 'This is my reply!');
});
client.on('messageUpdate', (_oldMessage, newMessage) => {
send(newMessage, 'This is my new reply!');
});
Sapphire Framework
Withconst { Command } = require('@sapphire/framework');
const { MessageEmbed } = require('discord.js');
const { send } = require('@skyra/editable-commands');
module.exports = class UserCommand extends Command {
constructor(context, options) {
super(context, {
...options,
description: 'A very cool command',
requiredClientPermissions: ['EMBED_LINKS']
});
}
run(message) {
const embed = new MessageEmbed()
.setURL('https://github.com/skyra-project/editable-commands')
.setColor('#7586D8')
.setDescription('Example description')
.setTimestamp();
return send(message, { embeds: [embed] });
}
};
TypeScript
Without a framework
import { send } from '@skyra/editable-commands';
client.on('messageCreate', (message) => {
send(message, 'This is my reply!');
});
client.on('messageUpdate', (_oldMessage, newMessage) => {
send(newMessage, 'This is my new reply!');
});
Sapphire Framework
Withimport { ApplyOptions } from '@sapphire/decorators';
import { Command, CommandOptions } from '@sapphire/framework';
import { Message, MessageEmbed } from 'discord.js';
import { send } from '@skyra/editable-commands';
@ApplyOptions<CommandOptions>({
description: 'A very cool command',
requiredClientPermissions: ['EMBED_LINKS']
})
export class UserCommand extends Command {
public run(message: Message) {
const embed = new MessageEmbed()
.setURL('https://github.com/skyra-project/editable-commands')
.setColor('#7586D8')
.setDescription('Example description')
.setTimestamp();
return send(message, { embeds: [embed] });
}
}
Buy us some doughnuts
Skyra Project is open source and always will be, even if we don't get donations. That said, we know there are amazing people who may still want to donate just to show their appreciation. Thanks you very much in advance!
We accept donations through Patreon, BitCoin, Ethereum, and Litecoin. You can use the buttons below to donate through your method of choice.
Donate With | QR | Address |
---|---|---|
Patreon | ![]() |
Click Here |
PayPal | ![]() |
Click Here |
BitCoin | ![]() |
3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco |
Ethereum | ![]() |
0xcB5EDB76Bc9E389514F905D9680589004C00190c |
Litecoin | ![]() |
MNVT1keYGMfGp7vWmcYjCS8ntU8LNvjnqM |
Contributors β¨
Thanks goes to these wonderful people (emoji key):
Antonio RomΓ‘n π» β οΈ π€ π |
Jeroen Claassens π |
depfu[bot] π§ |
This project follows the all-contributors specification. Contributions of any kind welcome!