mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
docs: correct grammar and typos in the Nodejs doc (#2109)
* Fix grammar * Correct grammar and typos
This commit is contained in:
@@ -52,7 +52,7 @@ module.exports = pingCommand;
|
|||||||
```
|
```
|
||||||
|
|
||||||
- The `BaseCommand` is extended with the `CommandResponses` class.
|
- The `BaseCommand` is extended with the `CommandResponses` class.
|
||||||
- The ping command class is been extended with the `BaseCommand` class.
|
- The ping command class is extended with the `BaseCommand` class.
|
||||||
- Some static properties are assigned to the ping command class, in order to access it in the cache, such as `name`,
|
- Some static properties are assigned to the ping command class, in order to access it in the cache, such as `name`,
|
||||||
`description`, `usage`, `category` and `slash`...
|
`description`, `usage`, `category` and `slash`...
|
||||||
- The `execute()` function will be called, when the command has been run by the user.
|
- The `execute()` function will be called, when the command has been run by the user.
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ const client = Discord.createBot({
|
|||||||
Discord.startBot(client);
|
Discord.startBot(client);
|
||||||
```
|
```
|
||||||
|
|
||||||
Moreover, you can customize the `EventManager` and add more functionality to it and make it exactly fit your your needs
|
Moreover, you can customize the `EventManager` and add more functionality to it and make it exactly fit your needs
|
||||||
or even emit events, by extending it.
|
or even emit events, by extending it.
|
||||||
|
|
||||||
Of course you wonder what you can do with all of this now. We will explain this further on the next page.
|
Of course you wonder what you can do with all of this now. We will explain this further on the next page.
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ Since the `EventEmitter` class is commonly used you probably already know it fro
|
|||||||
|
|
||||||
Discordeno decided against it as it comes with several downsides which are mentioned below.
|
Discordeno decided against it as it comes with several downsides which are mentioned below.
|
||||||
|
|
||||||
Performance plays a more important role than handling, however this event management system can be easily implemented
|
|
||||||
since it only needs a few changes in your code.
|
|
||||||
|
|
||||||
- It's easy to create memory leaks, when you add too many listeners or go carelessly with it.
|
- It's easy to create memory leaks, when you add too many listeners or go carelessly with it.
|
||||||
- Many fragmented parts of event code complicate maintenance.
|
- Many fragmented parts of event code complicate maintenance.
|
||||||
- ErrorHandling is difficult and debugging is harder when many listeners are open for the same events.
|
- ErrorHandling is difficult and debugging is harder when many listeners are open for the same events.
|
||||||
|
|
||||||
|
Performance plays a more important role than handling, however this event management system can be easily implemented
|
||||||
|
since it only needs a few changes in your code.
|
||||||
|
|
||||||
In the following we will show you, how to create an event manager, which is compatible with Discordeno's Client.
|
In the following we will show you, how to create an event manager, which is compatible with Discordeno's Client.
|
||||||
|
|
||||||
:::info template
|
:::info template
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ sidebar_position: 3
|
|||||||
|
|
||||||
When an event is fired, Discordeno sends two important things: the `client` instance and the `payload`.
|
When an event is fired, Discordeno sends two important things: the `client` instance and the `payload`.
|
||||||
|
|
||||||
As mentioned in the `Structure` section the `payload` object, does not contain any functions, its a plain json object.
|
As mentioned in the `Structure` section, the `payload` object does not contain any functions as it's a plain json object.
|
||||||
|
|
||||||
In order to take use of our nice built structures, we need to transform the payload into a structure.
|
In order to take use of our nice built structures, we need to transform the payload into a structure.
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Channel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async send(options) {
|
async send(options) {
|
||||||
return await client.helpers.sendMessage(this.id, options);
|
return await this.client.helpers.sendMessage(this.id, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ This is just very simple example, you can also add sub commands, select options
|
|||||||
|
|
||||||
## Handling Slash Commands
|
## Handling Slash Commands
|
||||||
|
|
||||||
Discord sends a WebSocket Event, when a user runs a slash command. You can listen to this event by add the
|
Discord sends a WebSocket Event when a user runs a slash command. You can listen to this event by adding the
|
||||||
`interactionCreate` function in the client.
|
`interactionCreate` function in the client.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
Reference in New Issue
Block a user