From 199b64fd19bf2dcf6a93c5d310c4335dbed49f52 Mon Sep 17 00:00:00 2001 From: Snazzah Date: Wed, 16 Dec 2020 00:09:22 -0600 Subject: [PATCH] v1.0.0 --- .github/workflows/lint.yml | 2 +- CHANGELOG.md | 25 +++++++++++++++++++++++-- README.md | 23 ++++++++++++++++++++++- package.json | 2 +- scripts/changelog.ts | 2 ++ 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7beee391..02ef8903 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Run linter +name: ESLint on: push: branches: diff --git a/CHANGELOG.md b/CHANGELOG.md index b2ba5d9e..28c8a6c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.0.0] - 2020-12-16 +### Removed: +- **[BREAKING]** `Context.initialResponseDeleted` +- **[BREAKING]** `treq` parameter from `SlashCreator#ping` event - The event no longer emits any parameters +### Changed: +- **[BREAKING]** `treq` parameter in `SlashCreator#unknownInteraction` event is now `interaction` +### Added: +- More documentation +- `Context.edit(messageID, content, options)` +- `Context.editOriginal(messageID, content, options)` +- `Context.expired` and internal handlers using this +- `Context.sendFollowUp(content, options)` +- `Message` and `User` class +- `GatewayServer` - Support for gateway events +- `SlashCreatorAPI.interactionCallback(id, token, body)` +- `Server.isWebserver` +- `Server.handleInteraction()` +### Fixed: +- Default error messages +- Exports for Constants and CommandOptionType ## [0.2.0] - 2020-12-16 ### Removed: - **[BREAKING]** `Context.acknowledge` now returns a promise @@ -13,12 +33,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Errors will be thrown if a Server without its installed package is instantiated ### Fixed: - RespondFunction is now a promise -- Context.send erroring +- `Context.send` erroring - Added/Updated debug emit lines - ExpressServer for TypeScript ## [0.1.0] - 2020-12-15 - Initial release. -[Unreleased]: https://github.com/Snazzah/slash-create/compare/v0.2.0...HEAD +[Unreleased]: https://github.com/Snazzah/slash-create/compare/v1.0.0...HEAD [0.1.0]: https://github.com/Snazzah/slash-create/releases/tag/v0.1.0 [0.2.0]: https://github.com/Snazzah/slash-create/compare/v0.1.0...v0.2.0 +[1.0.0]: https://github.com/Snazzah/slash-create/compare/v0.2.0...v1.0.0 diff --git a/README.md b/README.md index a2854114..076321ee 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@
# /create +[![NPM version](https://img.shields.io/npm/v/slash-create?maxAge=3600)](https://www.npmjs.com/package/slash-create) [![NPM downloads](https://img.shields.io/npm/dt/slash-create?maxAge=3600)](https://www.npmjs.com/package/slash-create) [![ESLint status](https://github.com/Snazzah/slash-create/workflows/ESLint/badge.svg)](https://github.com/Snazzah/slash-create/actions?query=workflow%3A%22ESLint%22) [![DeepScan grade](https://deepscan.io/api/teams/11596/projects/15103/branches/297399/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=11596&pid=15103&bid=297399) + Creator and handler for Discord's [slash commands](https://discord.com/developers/docs/interactions/slash-commands). You can create commands similar to Discord.JS [Commando](https://github.com/discordjs/Commando). -> This package is indev and may not work properly.
@@ -84,6 +85,26 @@ creator }) ) ); + +client.login('BOT_TOKEN_HERE'); +``` + +#### Example Command +```js +const { Command } = require('slash-create'); + +module.exports = class HelloCommand extends Command { + constructor(creator) { + super(creator, { + name: 'hello', + description: 'Says hello to you.' + }); + } + + async run(ctx) { + return `Hello, ${ctx.member.displayName}!`; + } +} ``` ##### Resources & References diff --git a/package.json b/package.json index 4d593198..f1efe672 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slash-create", - "version": "0.2.0", + "version": "1.0.0", "description": "Creator and handler for Discord's slash commands", "main": "./lib/index", "author": "Snazzah", diff --git a/scripts/changelog.ts b/scripts/changelog.ts index 4fdc60be..c9b06eb2 100644 --- a/scripts/changelog.ts +++ b/scripts/changelog.ts @@ -16,6 +16,8 @@ arr[1] = ## [${currentVersion}] - ${new Date().toISOString().slice(0, 10)} ### Removed: - **[BREAKING]** description +### Changed: +- ### Added: - ### Fixed: