From e112d901262fb753f44a10b93579a4714492328f Mon Sep 17 00:00:00 2001 From: Lioness100 Date: Tue, 19 Oct 2021 08:33:11 -0400 Subject: [PATCH] fix(docs): replace command usage of `run` to `messageRun` --- guides/getting-started/CreatingCommands.md | 6 +++--- .../containers/ClientPermissionsPrecondition.ts | 2 +- .../preconditions/containers/UserPermissionsPrecondition.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/guides/getting-started/CreatingCommands.md b/guides/getting-started/CreatingCommands.md index f65b1f475..a82efd3d5 100644 --- a/guides/getting-started/CreatingCommands.md +++ b/guides/getting-started/CreatingCommands.md @@ -38,7 +38,7 @@ To create a command you simply need to create a file with the name of the comman category you like, such as `./src/commands/General/`. Each command is a class that extends from the base `Command` class from Sapphire. You need to extend it, and add a -`run` method that will get called when your command is triggered. +`messageRun` method that will get called when your command is triggered. Don't forget to export the class! ```javascript @@ -52,7 +52,7 @@ module.exports = class extends Command { }); } - async run(message) { + async messageRun(message) { const msg = await message.channel.send('Ping?'); return msg.edit( `Pong! Bot Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${msg.createdTimestamp - message.createdTimestamp}ms.` @@ -65,6 +65,6 @@ The first parameter of `super` is the context, that is given in the constructor. {@link CommandOptions} object, containing properties such as the command's name or the command's description. -The `run` method is the method that gets called when the command is ran. It takes the message as the first argument. +The `messageRun` method is the method that gets called when the command is ran. It takes the message as the first argument. If everything was done correctly, you should now be able to launch your bot without errors and execute the `!ping` command. diff --git a/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts b/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts index 20f8a7980..2f09ab3c3 100644 --- a/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts +++ b/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts @@ -16,7 +16,7 @@ import type { PreconditionSingleResolvableDetails } from '../PreconditionContain * }); * } * - * public run(message: Message, args: Args) { + * public messageRun(message: Message, args: Args) { * // ... * } * } diff --git a/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts b/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts index d106e5878..4df6f5fb9 100644 --- a/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts +++ b/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts @@ -16,7 +16,7 @@ import type { PreconditionSingleResolvableDetails } from '../PreconditionContain * }); * } * - * public run(message: Message, args: Args) { + * public messageRun(message: Message, args: Args) { * // ... * } * }