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 grammar errors #35

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions docs/api/bdapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ id|string|ID uses for the style element
___

### deleteData <Badge type="danger">deprecated</Badge>
Deletes a piece of stored data. This is different than saving `null` or `undefined`.
Deletes a piece of stored data. This is different from saving `null` or `undefined`.

| Parameter | Type | Description |
|:----------|:------:|:----------------------:|
Expand Down Expand Up @@ -336,7 +336,7 @@ options.title|string|&#x2705;|*none*|Title for the titlebar
options.message|string|&#x2705;|*none*|Message for the dialog
options.showOverwriteConfirmation|boolean|&#x2705;|false|Whether the user should be prompted when overwriting a file
options.showHiddenFiles|boolean|&#x2705;|false|Whether hidden files should be shown in the dialog
options.promptToCreate|boolean|&#x2705;|false|Whether the user should be prompted to create non-existant folders
options.promptToCreate|boolean|&#x2705;|false|Whether the user should be prompted to create non-existent folders
options.openDirectory|boolean|&#x2705;|false|Whether the user should be able to select a directory as a target
options.openFile|boolean|&#x2705;|true|Whether the user should be able to select a file as a target
options.multiSelections|boolean|&#x2705;|false|Whether the user should be able to select multiple targets
Expand Down
2 changes: 1 addition & 1 deletion docs/api/logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ message|...any|Messages to have logged.
___

### log
Logs used for basic loggin.
Logs used for basic logging.

| Parameter | Type | Description |
|:----------|:------:|:----------------------:|
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ props|object|&#x274C;|*none*|
props.settings|Array.&lt;object&gt;|&#x274C;|*none*|Array of settings to show
props.onChange|CallableFunction|&#x274C;|*none*|Function called on every change
props.onDrawerToggle|CallableFunction|&#x2705;|*none*|Optionally used to save drawer states
props.getDrawerState|CallableFunction|&#x2705;|*none*|Optionially used to recall drawer states
props.getDrawerState|CallableFunction|&#x2705;|*none*|Optionally used to recall drawer states

**Returns:** `void`
___
Expand Down Expand Up @@ -109,7 +109,7 @@ ___
### showChangelogModal
Shows a changelog modal in a similar style to Discord's. Customizable with images, videos, colored sections and supports markdown.

The changes option is a array of objects that have this typing:
The changes option is an array of objects that have this typing:
```ts
interface Changes {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Please see the table below for details on the fields.

|Field|Required|Description|
|-----|:------:|-----------|
|name|&#x2705;|The name of the addon. Typcially does not contain spaces, but is allowed.|
|name|&#x2705;|The name of the addon. Typically does not contain spaces, but is allowed.|
|author|&#x2705;|The name of you the developer.|
|description|&#x2705;|A basic description of the what the addon does.|
|version|&#x2705;|Version representing the current update level. [Semantic versioning](https://semver.org/) recommended.|
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ These are tools that help with both general web development, and working with th

If you have past web development experience you are probably already familiar with the Chrome/Chromium DevTools. If not, it might be a good idea to give [its documentation](https://developer.chrome.com/docs/devtools/) a once-over.

Working in this Discord (and BetterDiscord) environment, we have access to these DevTools. Discord has this disabled by default, but it is possible to reenable this functionality in the BetterDiscord settings. Go to the BetterDiscord Settings page and find the Developer Settings. Then check the option for DevTools.
Working in this Discord (and BetterDiscord) environment, we have access to these DevTools. Discord has this disabled by default, but it is possible to readable this functionality in the BetterDiscord settings. Go to the BetterDiscord Settings page and find the Developer Settings. Then check the option for DevTools.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
yes.... That's my mistake.


![Developer Tools](./img/developer_settings.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ No not the one burning up, but the development environment for BetterDiscord plu

### Desktop Application

Discord Desktop is an [Electron](https://www.electronjs.org/) application which means it is _essentially_ a chromium web browser that only displays Discord. That is an oversimplification but it's a good high level understanding to have. What makes Electron more than just a browser, is that it bundles Node.js with it, giving every Electron application the ability to interact beyond the capabilities of a web browser and make use of the user's computer.
Discord Desktop is an [Electron](https://www.electronjs.org/) application which means it is _essentially_ a Chromium web browser that only displays Discord. That is an oversimplification, but it's a good high level understanding to have. What makes Electron more than just a browser, is that it bundles Node.js with it, giving every Electron application the ability to interact beyond the capabilities of a web browser and make use of the user's computer.

To get a better sense of what this does, think of the limitations of making an application in a web browser. Actions like loading and saving local files, listening to keybinds globally, and controlling the user's clipboard are just not possible in the web browser. Most of these limitations are for security reasons, but with [Node.js](https://nodejs.org/), suddenly those are all very possible.

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Currently, BetterDiscord only supports two main types of addons: [Plugins](../pl

## Plugins

Plugins are a type of addon that focus on functionality by adding something new to the Discord client. This could be as simple as a button that says hello, or basic end-to-end ecryption. Plugins can also modify existing functionality in the client like altering exisiting buttons to perform different actions, or even remove functionality entirely. All of this is done using JavaScript with minimal requirements to allow for personal preference and style in programming. To read more about making them, check out the [plugin documentation](../plugins/) after finishing this section.
Plugins are a type of addon that focus on functionality by adding something new to the Discord client. This could be as simple as a button that says hello, or basic end-to-end encryption. Plugins can also modify existing functionality in the client like altering exisiting buttons to perform different actions, or even remove functionality entirely. All of this is done using JavaScript with minimal requirements to allow for personal preference and style in programming. To read more about making them, check out the [plugin documentation](../plugins/) after finishing this section.

## Themes

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/submitting.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Due to our small team size, we have no guarantees for how long a review can take

### Denial

1. You'll get a notification that your submission was denied along with a reason mesage.
1. You'll get a notification that your submission was denied along with a reason message.
2. Check your GitHub for any issues opened by the review team.
2. Make any necessary changes and resubmit.

Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/advanced/patching.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A function patch an advanced technique for plugins that allow you to modify exis

### Why would I use one?

It's a great way to modify or extend Discord's functionality with your own while keeping integration mostly seemless. It can also act as a way to modify the way Discord works currently. Take the plugin [HideDisabledEmojis](https://betterdiscord.app/plugin/HideDisabledEmojis) for example, it uses function patching to modify the way Discord's internal functions work to stop trying to render emojis the user cannot use. Your possibilities for the plugins you can make increase exponentially, and the quality usually ends up being higher due to the tight integration with Discord.
It's a great way to modify or extend Discord's functionality with your own while keeping integration mostly seamless. It can also act as a way to modify the way Discord works currently. Take the plugin [HideDisabledEmojis](https://betterdiscord.app/plugin/HideDisabledEmojis) for example, it uses function patching to modify the way Discord's internal functions work to stop trying to render emojis the user cannot use. Your possibilities for the plugins you can make increase exponentially, and the quality usually ends up being higher due to the tight integration with Discord.

### How can I patch a function?

Expand Down Expand Up @@ -76,7 +76,7 @@ BdApi.Patcher.instead("MyPlugin", someObject, "yourTarget", () => console.log("g
targetUser(); // Now logs "green"
```

This code has the some effect as before, causing `targetUser` to instead log `green`. But lets take a closer look at the highlighted line. We have a call to `BdApi.Patcher.instead` which indicates we want to create an `instead` patch. We pass it `"MyPlugin"` which is an identifier used later to help removed all your patches with `BdApi.Patcher.unpatchAll`. Then we give it the target object `someObject` and the key of our target inside that object `yourTarget` and our new function to override the original. BetterDiscord takes care of the rest and even allows other plugins to patch on top of yours.
This code has the same effect as before, causing `targetUser` to instead log `green`. But let's take a closer look at the highlighted line. We have a call to `BdApi.Patcher.instead` which indicates we want to create an `instead` patch. We pass it `"MyPlugin"` which is an identifier used later to help removed all your patches with `BdApi.Patcher.unpatchAll`. Then we give it the target object `someObject` and the key of our target inside that object `yourTarget` and our new function to override the original. BetterDiscord takes care of the rest and even allows other plugins to patch on top of yours.


## Examples
Expand Down Expand Up @@ -155,7 +155,7 @@ someModule.method(1); // > Intercepted other
someModule.method(1); // > undefined
```

Take alook at the function we define in the `instead` patch. We have a new parameter `originalFunction` that BetterDiscord gives us to use as we see fit. In this example we use it for a specific value. If the value is `5` we let the original function run and return without modification. If the value is `1` we pass it to an external function and let that handle the arguments and the return. Otherwise, the function has no return value at all. This is a huge change to the function. It used to always return a value and now it only returns values for two cases. This is a good demonstration how much power function patching can have.
Take a look at the function we define in the `instead` patch. We have a new parameter `originalFunction` that BetterDiscord gives us to use as we see fit. In this example we use it for a specific value. If the value is `5` we let the original function run and return without modification. If the value is `1` we pass it to an external function and let that handle the arguments and the return. Otherwise, the function has no return value at all. This is a huge change to the function. It used to always return a value, and now it only returns values for two cases. This is a good demonstration how much power function patching can have.

### After

Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/advanced/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide involves [function patching](./patching.md). If you have not read tha

### What does it mean?

When we say React Injection, we're referring to adding/removing/alterting components in the React render tree used by Discord. In the [React](../intermediate/react.md) section of the guide, we went over rendering our own components using `ReactDOM` which created our own React trees rendering outside of Discord's tree. With injection we can either be part of Discord's tree with our own elements, or we can modify Discord's tree before a render finishes.
When we say React Injection, we're referring to adding/removing/altering components in the React render tree used by Discord. In the [React](../intermediate/react.md) section of the guide, we went over rendering our own components using `ReactDOM` which created our own React trees rendering outside of Discord's tree. With injection we can either be part of Discord's tree with our own elements, or we can modify Discord's tree before a render finishes.

### Why would I need it?

Expand Down Expand Up @@ -59,7 +59,7 @@ Let's take a look at this component and see if it's exported like we did in the

![view_source](./img/view_source.png)

And of course also beautify the code with the button a the bottom left. You'll see a render function much like this.
And of course also beautify the code with the button at the bottom left. You'll see a render function much like this.

![react_render](./img/react_render.png)

Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/advanced/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Due to the nature of client modding, this section could be outdated by the time

Now that we know what information we can search on, how do we even find a module we want to get? And once we find it, how do we know whether it's even accessible? Keep in mind that some modules in Discord are completely wrapped and cannot be accessed through this API or through reflection of any kind.

But to answer these questions, let's step through a very simple example. Let's say we want to open settings programmtically. We know that the settings button can do that, so we'll start there. Begin by selecting that element and printing it out in console with `$0`. You'll see in the autocomplete that it has some property that looks like `__reactFiber$2oq7t5kq3k5`. Go ahead and select that and print it out. This is the data React currently has about this node. Using this is a good way to understand how React works and a great way to start with reverse engineering in Discord. Through this you can walk the React tree and see all the elements React knows about. But we are more interested in the properties of this `button` because we want to essentially duplicate the `onClick` listener.
But to answer these questions, let's step through a very simple example. Let's say we want to open settings programmatically. We know that the settings button can do that, so we'll start there. Begin by selecting that element and printing it out in console with `$0`. You'll see in the autocomplete that it has some property that looks like `__reactFiber$2oq7t5kq3k5`. Go ahead and select that and print it out. This is the data React currently has about this node. Using this is a good way to understand how React works and a great way to start with reverse engineering in Discord. Through this you can walk the React tree and see all the elements React knows about. But we are more interested in the properties of this `button` because we want to essentially duplicate the `onClick` listener.

Now let's print out the property that looks like `__reactProps$2oq7t5kq3k5` instead. You'll see in this object all the React props specific to this element including an `onClick` function. Let's dive into this either by right-clicking and selecting `Show Function Definition` or by expanding the function and clicking on the function location.

Expand Down Expand Up @@ -111,7 +111,7 @@ And there it is, the object we wanted, with the function we wanted. You might ha

![default_export](./img/default_export.png)

Now the `Z` is back and BetterDisord returned the whole module, not just the default export. So let's stick with the first version since we just want to use the object directly. And let's take a look at the `open` function definition and figure out how it works so we can use it.
Now the `Z` is back and BetterDiscord returned the whole module, not just the default export. So let's stick with the first version since we just want to use the object directly. And let's take a look at the `open` function definition and figure out how it works so we can use it.

![open](./img/open.png)

Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/basics/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Within BetterDiscord you can interact with different addons in two main ways. Ei

## AddonAPI

The addon api is available as part of `BdApi`. Theres two instances, one for plugins and one for themes at `BdApi.Plugins` and `BdApi.Themes` respectively. This api has a few helpful utilities for interacting with other plugins, and even has the current addon folder as a property. For a more exhaustive list of available methods and properties, take a look at the [api reference](/api/bdapi).
The addon api is available as part of `BdApi`. There's two instances, one for plugins and one for themes at `BdApi.Plugins` and `BdApi.Themes` respectively. This api has a few helpful utilities for interacting with other plugins, and even has the current addon folder as a property. For a more exhaustive list of available methods and properties, take a look at the [api reference](/api/bdapi).

## Getting Addons

Expand Down Expand Up @@ -43,7 +43,7 @@ If you have the ID of the addon you'd like to toggle, this is pretty straightfor
BdApi.Themes.toggle("Nox");
```

Of course you can have more granular control and specifically enable or disable when you need to. You can even combine all three.
Of course, you can have more granular control and specifically enable or disable when you need to. You can even combine all three.

```js
BdApi.Themes.enable("Nox"); // Nox is now enabled
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/basics/creating-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = meta => {
```
:::

It's worth noting when deciding that each plugin is loaded similarly to a node module. This means that defining variables outside of the `module.exports` will not result in scope creep or variable bloat.
It's worth noting when deciding that each plugin is loaded similarly to a node module. This means that defining variables outside the `module.exports` will not result in scope creep or variable bloat.

Once you've got that decided, go ahead and save your template in your [plugins folder](../introduction/quick-start#plugin-folder) as `ExamplePlugin.plugin.js` and change `ExamplePlugin` to the name of your choice.

Expand Down
Loading