Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): replace command usage of run to messageRun #310

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions guides/getting-started/CreatingCommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.`
Expand All @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { PreconditionSingleResolvableDetails } from '../PreconditionContain
* });
* }
*
* public run(message: Message, args: Args) {
* public messageRun(message: Message, args: Args) {
* // ...
* }
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { PreconditionSingleResolvableDetails } from '../PreconditionContain
* });
* }
*
* public run(message: Message, args: Args) {
* public messageRun(message: Message, args: Args) {
* // ...
* }
* }
Expand Down