https://github.com/skyra-project/editable-commands
A framework agnostic library for editable commands.
https://github.com/skyra-project/editable-commands
hacktoberfest
Last synced: over 1 year ago
JSON representation
A framework agnostic library for editable commands.
- Host: GitHub
- URL: https://github.com/skyra-project/editable-commands
- Owner: skyra-project
- License: mit
- Created: 2020-11-28T23:37:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T02:03:01.000Z (about 2 years ago)
- Last Synced: 2024-05-19T03:20:03.262Z (about 2 years ago)
- Topics: hacktoberfest
- Language: TypeScript
- Homepage:
- Size: 13.2 MB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README

# @skyra/editable-commands
**A framework agnostic library for editable commands**
[](https://github.com/skyra-project/editable-commands/blob/main/LICENSE.md)
[](https://www.npmjs.com/package/@skyra/editable-commands)
[](https://join.skyra.pw)
---
## 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.
```sh
npm install @skyra/editable-commands
```
## Usage
### JavaScript
#### Without a framework
```js
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][sapphire]
```js
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
```ts
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][sapphire]
```ts
import { ApplyOptions } from '@sapphire/decorators';
import { Command, CommandOptions } from '@sapphire/framework';
import { Message, MessageEmbed } from 'discord.js';
import { send } from '@skyra/editable-commands';
@ApplyOptions({
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](https://www.patreon.com/kyranet) |
| PayPal | ![PayPalImage][] | [Click Here](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CET28NRZTDQ8L) |
| BitCoin | ![BitcoinImage][] | [3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco](bitcoin:3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco?amount=0.01&label=Skyra%20Discord%20Bot) |
| Ethereum | ![EthereumImage][] | [0xcB5EDB76Bc9E389514F905D9680589004C00190c](ethereum:0xcB5EDB76Bc9E389514F905D9680589004C00190c?amount=0.01&label=Skyra%20Discord%20Bot) |
| Litecoin | ![LitecoinImage][] | [MNVT1keYGMfGp7vWmcYjCS8ntU8LNvjnqM](litecoin:MNVT1keYGMfGp7vWmcYjCS8ntU8LNvjnqM?amount=0.01&label=Skyra%20Discord%20Bot) |
## Contributors
Please make sure to read the [Contributing Guide][contributing] before making a pull request.
Thank you to all the people who already contributed to Skyra Project!
[contributing]: https://github.com/skyra-project/.github/blob/main/.github/CONTRIBUTING.md
[patreonimage]: https://cdn.skyra.pw/gh-assets/patreon.png
[paypalimage]: https://cdn.skyra.pw/gh-assets/paypal.png
[bitcoinimage]: https://cdn.skyra.pw/gh-assets/bitcoin.png
[ethereumimage]: https://cdn.skyra.pw/gh-assets/ethereum.png
[litecoinimage]: https://cdn.skyra.pw/gh-assets/litecoin.png
[sapphire]: https://github.com/sapphiredev/framework