Skip to content

Commit

Permalink
feat(plugin-editable-commands): added first version
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Aug 8, 2021
1 parent c6f650a commit c43976f
Show file tree
Hide file tree
Showing 15 changed files with 357 additions and 111 deletions.
199 changes: 88 additions & 111 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,113 +1,90 @@
{
"projectName": "plugins",
"projectOwner": "sapphiredev",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md",
"packages/api/README.md",
"packages/logger/README.md",
"packages/i18next/README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "angular",
"contributors": [
{
"login": "Favna",
"name": "Jeroen Claassens",
"avatar_url": "https://avatars3.githubusercontent.com/u/4019718?v=4",
"profile": "https://favware.tech/",
"contributions": [
"code",
"infra",
"projectManagement"
]
},
{
"login": "QuantumlyTangled",
"name": "Nejc Drobnic",
"avatar_url": "https://avatars1.githubusercontent.com/u/7919610?v=4",
"profile": "https://quantumlytangled.com",
"contributions": [
"code",
"doc"
]
},
{
"login": "kyranet",
"name": "Antonio Román",
"avatar_url": "https://avatars0.githubusercontent.com/u/24852502?v=4",
"profile": "https://github.com/kyranet",
"contributions": [
"code"
]
},
{
"login": "vladfrangu",
"name": "Vlad Frangu",
"avatar_url": "https://avatars3.githubusercontent.com/u/17960496?v=4",
"profile": "https://github.com/vladfrangu",
"contributions": [
"review"
]
},
{
"login": "depfu[bot]",
"name": "depfu[bot]",
"avatar_url": "https://avatars3.githubusercontent.com/in/715?v=4",
"profile": "https://github.com/apps/depfu",
"contributions": [
"maintenance"
]
},
{
"login": "dependabot[bot]",
"name": "dependabot[bot]",
"avatar_url": "https://avatars0.githubusercontent.com/in/29110?v=4",
"profile": "https://github.com/apps/dependabot",
"contributions": [
"maintenance"
]
},
{
"login": "allcontributors[bot]",
"name": "allcontributors[bot]",
"avatar_url": "https://avatars0.githubusercontent.com/in/23186?v=4",
"profile": "https://github.com/apps/allcontributors",
"contributions": [
"doc"
]
},
{
"login": "Nytelife26",
"name": "Tyler J Russell",
"avatar_url": "https://avatars1.githubusercontent.com/u/22531310?v=4",
"profile": "https://github.com/Nytelife26",
"contributions": [
"code"
]
},
{
"login": "Stitch07",
"name": "Stitch07",
"avatar_url": "https://avatars.githubusercontent.com/u/29275227?v=4",
"profile": "https://github.com/Stitch07",
"contributions": [
"code",
"bug"
]
},
{
"login": "PlatinBae",
"name": "PlatinBae",
"avatar_url": "https://avatars.githubusercontent.com/u/50950966?v=4",
"profile": "https://github.com/PlatinBae",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
"skipCi": true
"projectName": "plugins",
"projectOwner": "sapphiredev",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md",
"packages/api/README.md",
"packages/editable-commands/README.md",
"packages/logger/README.md",
"packages/i18next/README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "angular",
"contributors": [
{
"login": "Favna",
"name": "Jeroen Claassens",
"avatar_url": "https://avatars3.githubusercontent.com/u/4019718?v=4",
"profile": "https://favware.tech/",
"contributions": ["code", "infra", "projectManagement"]
},
{
"login": "QuantumlyTangled",
"name": "Nejc Drobnic",
"avatar_url": "https://avatars1.githubusercontent.com/u/7919610?v=4",
"profile": "https://quantumlytangled.com",
"contributions": ["code", "doc"]
},
{
"login": "kyranet",
"name": "Antonio Román",
"avatar_url": "https://avatars0.githubusercontent.com/u/24852502?v=4",
"profile": "https://github.com/kyranet",
"contributions": ["code"]
},
{
"login": "vladfrangu",
"name": "Vlad Frangu",
"avatar_url": "https://avatars3.githubusercontent.com/u/17960496?v=4",
"profile": "https://github.com/vladfrangu",
"contributions": ["review"]
},
{
"login": "depfu[bot]",
"name": "depfu[bot]",
"avatar_url": "https://avatars3.githubusercontent.com/in/715?v=4",
"profile": "https://github.com/apps/depfu",
"contributions": ["maintenance"]
},
{
"login": "dependabot[bot]",
"name": "dependabot[bot]",
"avatar_url": "https://avatars0.githubusercontent.com/in/29110?v=4",
"profile": "https://github.com/apps/dependabot",
"contributions": ["maintenance"]
},
{
"login": "allcontributors[bot]",
"name": "allcontributors[bot]",
"avatar_url": "https://avatars0.githubusercontent.com/in/23186?v=4",
"profile": "https://github.com/apps/allcontributors",
"contributions": ["doc"]
},
{
"login": "Nytelife26",
"name": "Tyler J Russell",
"avatar_url": "https://avatars1.githubusercontent.com/u/22531310?v=4",
"profile": "https://github.com/Nytelife26",
"contributions": ["code"]
},
{
"login": "Stitch07",
"name": "Stitch07",
"avatar_url": "https://avatars.githubusercontent.com/u/29275227?v=4",
"profile": "https://github.com/Stitch07",
"contributions": ["code", "bug"]
},
{
"login": "PlatinBae",
"name": "PlatinBae",
"avatar_url": "https://avatars.githubusercontent.com/u/50950966?v=4",
"profile": "https://github.com/PlatinBae",
"contributions": ["doc"]
}
],
"contributorsPerLine": 7,
"skipCi": true
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
**Packages**

[![npm](https://img.shields.io/npm/v/@sapphire/plugin-api?color=crimson&logo=npm&style=flat-square&label=@sapphire/plugin-api)](https://www.npmjs.com/package/@sapphire/plugin-api)
[![npm](https://img.shields.io/npm/v/@sapphire/plugin-editable-commands?color=crimson&logo=npm&style=flat-square&label=@sapphire/plugin-editable-commands)](https://www.npmjs.com/package/@sapphire/plugin-editable-commands)
[![npm](https://img.shields.io/npm/v/@sapphire/plugin-logger?color=crimson&logo=npm&style=flat-square&label=@sapphire/plugin-logger)](https://www.npmjs.com/package/@sapphire/plugin-logger)
[![npm](https://img.shields.io/npm/v/@sapphire/plugin-i18next?color=crimson&logo=npm&style=flat-square&label=@sapphire/plugin-i18next)](https://www.npmjs.com/package/@sapphire/plugin-i18next)
[![npm](https://img.shields.io/npm/v/@sapphire/plugin-subcommands?color=crimson&logo=npm&style=flat-square&label=@sapphire/plugin-subcommands)](https://www.npmjs.com/package/@sapphire/plugin-subcommands)
Expand Down
120 changes: 120 additions & 0 deletions packages/editable-commands/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<div align="center">

![Sapphire Logo](https://cdn.skyra.pw/gh-assets/sapphire-banner.png)

# @sapphire/plugin-editable-commands

**Plugin for <a href="https://github.com/sapphiredev/framework">@sapphire/framework</a> to have editable commands.**

[![GitHub](https://img.shields.io/github/license/sapphiredev/plugins)](https://github.com/sapphiredev/plugins/blob/main/LICENSE.md)
[![codecov](https://codecov.io/gh/sapphiredev/plugins/branch/main/graph/badge.svg?token=QWL8FB16BR)](https://codecov.io/gh/sapphiredev/plugins)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@sapphire/plugin-editable-commands?logo=webpack&style=flat-square)](https://bundlephobia.com/result?p=@sapphire/plugin-editable-commands)
[![npm](https://img.shields.io/npm/v/@sapphire/plugin-editable-commands?color=crimson&logo=npm&style=flat-square)](https://www.npmjs.com/package/@sapphire/plugin-editable-commands)
[![Depfu](https://badges.depfu.com/badges/11bbf7392987e6fd51fc6559e1d42dfc/count.svg)](https://depfu.com/github/sapphiredev/plugins?project_id=15201)

</div>

## Description

TBD.

## Features

- Fully ready for TypeScript!
- Includes ESM ready entrypoint
- Full editable commands, attachments included!

## Installation

`@sapphire/plugin-editable-commands` depends on the following packages. Be sure to install these along with this package!

- [`@sapphire/framework`](https://www.npmjs.com/package/@sapphire/framework)

You can use the following command to install this package, or replace `npm install` with your package manager of choice.

```sh
npm install @sapphire/plugin-editable-commands @sapphire/framework
```

---

## Usage

In your main or setup file, register the plugin:

```typescript
import '@sapphire/plugin-editable-commands/register';
```

Then use `send` or `reply` from the package, as shown below:

```typescript
import { ApplyOptions } from '@sapphire/decorators';
import { Command, CommandOptions } from '@sapphire/framework';
import { Message, MessageEmbed } from 'discord.js';
import { send } from '@sapphire/plugin-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/sapphiredev/plugins')
.setColor('#7586D8')
.setDescription('Example description')
.setTimestamp();

return send(message, { embeds: [embed] });
}
}
```

## Editable Commands Documentation

For the full @sapphire/plugin-editable-commands documentation please refer to the TypeDoc generated [documentation](https://sapphiredev.github.io/plugins/modules/_sapphire_plugin_editable-commands.html).

## Buy us some doughnuts

Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!

We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.

| Donate With | Address |
| :-------------: | :-------------------------------------------------: |
| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |
| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |
| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
| PayPal | [Click Here](https://sapphirejs.dev/paypal) |

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://favware.tech/"><img src="https://avatars3.githubusercontent.com/u/4019718?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeroen Claassens</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=Favna" title="Code">💻</a> <a href="#infra-Favna" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#projectManagement-Favna" title="Project Management">📆</a></td>
<td align="center"><a href="https://quantumlytangled.com"><img src="https://avatars1.githubusercontent.com/u/7919610?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nejc Drobnic</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=QuantumlyTangled" title="Code">💻</a> <a href="https://github.com/sapphiredev/plugins/commits?author=QuantumlyTangled" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/kyranet"><img src="https://avatars0.githubusercontent.com/u/24852502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Antonio Román</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=kyranet" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vladfrangu"><img src="https://avatars3.githubusercontent.com/u/17960496?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vlad Frangu</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/pulls?q=is%3Apr+reviewed-by%3Avladfrangu" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/apps/depfu"><img src="https://avatars3.githubusercontent.com/in/715?v=4?s=100" width="100px;" alt=""/><br /><sub><b>depfu[bot]</b></sub></a><br /><a href="#maintenance-depfu[bot]" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/apps/dependabot"><img src="https://avatars0.githubusercontent.com/in/29110?v=4?s=100" width="100px;" alt=""/><br /><sub><b>dependabot[bot]</b></sub></a><br /><a href="#maintenance-dependabot[bot]" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/apps/allcontributors"><img src="https://avatars0.githubusercontent.com/in/23186?v=4?s=100" width="100px;" alt=""/><br /><sub><b>allcontributors[bot]</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=allcontributors[bot]" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Nytelife26"><img src="https://avatars1.githubusercontent.com/u/22531310?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tyler J Russell</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=Nytelife26" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Stitch07"><img src="https://avatars.githubusercontent.com/u/29275227?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stitch07</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=Stitch07" title="Code">💻</a> <a href="https://github.com/sapphiredev/plugins/issues?q=author%3AStitch07" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/PlatinBae"><img src="https://avatars.githubusercontent.com/u/50950966?v=4?s=100" width="100px;" alt=""/><br /><sub><b>PlatinBae</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=PlatinBae" title="Documentation">📖</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
68 changes: 68 additions & 0 deletions packages/editable-commands/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@sapphire/plugin-editable-commands",
"version": "0.0.1",
"description": "Plugin for @sapphire/framework to have editable commands",
"author": "@sapphire",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./register": {
"import": "./register.mjs",
"require": "./register.js"
}
},
"sideEffects": [
"./dist/register.js",
"./register.js",
"./register.mjs"
],
"homepage": "https://github.com/sapphiredev/plugins/tree/main/packages/editable-commands",
"scripts": {
"lint": "eslint src tests --ext ts --fix",
"build": "tsc -b src",
"postbuild": "run-p esm:**",
"esm:register": "gen-esm-wrapper dist/register.js dist/register.mjs",
"esm:default": "gen-esm-wrapper dist/index.js dist/index.mjs",
"prepublishOnly": "yarn build"
},
"dependencies": {
"@skyra/editable-commands": "^2.1.0",
"tslib": "^2.3.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sapphiredev/plugins.git",
"directory": "packages/editable-commands"
},
"files": [
"dist",
"!dist/*.tsbuildinfo",
"register.*"
],
"engines": {
"node": ">=14",
"npm": ">=6"
},
"keywords": [
"sapphiredev",
"plugin",
"bot",
"typescript",
"ts",
"yarn",
"discord",
"sapphire"
],
"bugs": {
"url": "https://github.com/sapphiredev/plugins/issues"
},
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit c43976f

Please sign in to comment.