@sapphire/framework
Advanced tools
Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8
@@ -5,2 +5,19 @@ # Changelog | ||
## [1.0.0-alpha.8](https://github.com/sapphire-project/framework/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2021-02-07) | ||
### ⚠ BREAKING CHANGES | ||
- **events:** Changed `Events.UnknownCommandName` event arguments to `UnknownCommandNamePayload`. | ||
- **events:** Changed `Events.UnknownCommand` event arguments to `UnknownCommandPayload`. | ||
Co-authored-by: Jeroen Claassens <support@favware.tech> | ||
- **events:** CoreMessageParser is not longer a message event listener | ||
### Features | ||
- **events:** create Events.PreMessageParsed ([#164](https://github.com/sapphire-project/framework/issues/164)) ([0311838](https://github.com/sapphire-project/framework/commit/0311838d59d7071a37ea932a094dbab0c26e84c1)) | ||
- **events:** remove UnknownCommandName, changed UnknownCommand ([#165](https://github.com/sapphire-project/framework/issues/165)) ([c3273d1](https://github.com/sapphire-project/framework/commit/c3273d100259c3905c5d3955be4a3b1d5aec24ef)) | ||
## [1.0.0-alpha.7](https://github.com/sapphire-project/framework/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2021-02-06) | ||
@@ -7,0 +24,0 @@ |
@@ -9,9 +9,6 @@ "use strict"; | ||
constructor(context) { | ||
super(context, { event: Events_1.Events.Message }); | ||
super(context, { event: Events_1.Events.PreMessageParsed }); | ||
this.requiredPermissions = new discord_js_1.Permissions(['VIEW_CHANNEL', 'SEND_MESSAGES']).freeze(); | ||
} | ||
async run(message) { | ||
// Stop bots and webhooks from running commands. | ||
if (message.author.bot || message.webhookID) | ||
return; | ||
// If the bot cannot run the command due to lack of permissions, return. | ||
@@ -18,0 +15,0 @@ const canRun = await this.canRunInChannel(message); |
@@ -19,4 +19,4 @@ "use strict"; | ||
const commandName = spaceIndex === -1 ? prefixLess : prefixLess.slice(0, spaceIndex); | ||
if (!commandName) { | ||
client.emit(Events_1.Events.UnknownCommandName, message, prefix); | ||
if (commandName.length === 0) { | ||
client.emit(Events_1.Events.UnknownCommandName, { message, prefix, commandPrefix }); | ||
return; | ||
@@ -27,3 +27,3 @@ } | ||
if (!command) { | ||
client.emit(Events_1.Events.UnknownCommand, message, commandName, prefix); | ||
client.emit(Events_1.Events.UnknownCommand, { message, prefix, commandPrefix }); | ||
return; | ||
@@ -30,0 +30,0 @@ } |
@@ -63,2 +63,3 @@ "use strict"; | ||
Events["EventError"] = "eventError"; | ||
Events["PreMessageParsed"] = "preMessageParsed"; | ||
Events["PrefixedMessage"] = "prefixedMessage"; | ||
@@ -65,0 +66,0 @@ Events["UnknownCommandName"] = "unknownCommandName"; |
{ | ||
"name": "@sapphire/framework", | ||
"version": "1.0.0-alpha.7", | ||
"version": "1.0.0-alpha.8", | ||
"description": "Discord bot framework built on top of @sapphire/lib for advanced and amazing bots.", | ||
@@ -64,3 +64,3 @@ "main": "dist/index.js", | ||
"pretty-quick": "^3.1.0", | ||
"rollup": "^2.38.4", | ||
"rollup": "^2.38.5", | ||
"rollup-plugin-dts": "^2.0.1", | ||
@@ -70,3 +70,3 @@ "standard-version": "^9.1.0", | ||
"ts-node": "^9.1.1", | ||
"typedoc": "^0.20.20", | ||
"typedoc": "^0.20.23", | ||
"typedoc-plugin-nojekyll": "^1.0.1", | ||
@@ -73,0 +73,0 @@ "typescript": "^4.1.3" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
283818
135
4637