@skyra/editable-commands

A framework agnostic library for editable commands

Usage no npm install needed!

<script type="module">
  import skyraEditableCommands from 'https://cdn.skypack.dev/@skyra/editable-commands';
</script>

README

Skyra Logo

@skyra/editable-commands

A framework agnostic library for editable commands

GitHub

npm

Support Server


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!');
});

With Sapphire Framework

const { 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!');
});

With Sapphire Framework

import { 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 PatreonImage Click Here
PayPal PayPalImage Click Here
BitCoin BitcoinImage 3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco
Ethereum EthereumImage 0xcB5EDB76Bc9E389514F905D9680589004C00190c
Litecoin LitecoinImage 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!