├── .github └── workflows │ └── build-and-deploy.yml ├── .gitignore ├── .vitepress ├── config.ts └── theme │ ├── custom.css │ └── index.ts ├── CONTRIBUTING.md ├── README.md ├── docs ├── api │ ├── addonapi.md │ ├── bdapi.md │ ├── components.md │ ├── contextmenu.md │ ├── data.md │ ├── dom.md │ ├── filters.md │ ├── index.md │ ├── logger.md │ ├── net.md │ ├── patcher.md │ ├── reactutils.md │ ├── ui.md │ ├── utils.md │ └── webpack.md ├── developers │ ├── addons.md │ ├── devtools.md │ ├── environment.md │ ├── img │ │ ├── connect.png │ │ ├── developer_settings.png │ │ ├── devtools_tab_overflow.png │ │ ├── react_devtools.png │ │ └── submit.png │ ├── index.md │ └── submitting.md ├── discord │ ├── index.md │ ├── modules │ │ ├── data-stores.md │ │ ├── flux-events.md │ │ └── index.md │ └── variables.md ├── index.md ├── plugins │ ├── advanced │ │ ├── img │ │ │ ├── breakpoint_click.png │ │ │ ├── breakpoint_handle.png │ │ │ ├── click_minified.png │ │ │ ├── click_script.png │ │ │ ├── default_export.png │ │ │ ├── exports.png │ │ │ ├── function_location.png │ │ │ ├── open.png │ │ │ ├── our_button.png │ │ │ ├── react_ancestor.png │ │ │ ├── react_candidate.png │ │ │ ├── react_component.png │ │ │ ├── react_exports.png │ │ │ ├── react_parent.png │ │ │ ├── react_path.png │ │ │ ├── react_render.png │ │ │ ├── react_target.png │ │ │ ├── return_value.png │ │ │ ├── return_value_expanded.png │ │ │ ├── right_click.png │ │ │ ├── tree_traversal.png │ │ │ ├── view_source.png │ │ │ ├── webpack_allstrings.png │ │ │ └── webpack_bykeys.png │ │ ├── patching.md │ │ ├── react.md │ │ └── webpack.md │ ├── basics │ │ ├── addons.md │ │ ├── creating-a-plugin.md │ │ ├── discord.md │ │ ├── dom.md │ │ ├── img │ │ │ ├── plugin_settings.png │ │ │ ├── servers.png │ │ │ └── ui │ │ │ │ ├── alert_basic.png │ │ │ │ ├── alert_console.png │ │ │ │ ├── alert_input.png │ │ │ │ ├── alert_react.png │ │ │ │ ├── confirmation_advanced.png │ │ │ │ ├── confirmation_basic.png │ │ │ │ ├── modal.png │ │ │ │ ├── notice.png │ │ │ │ ├── notice_advanced.png │ │ │ │ ├── notice_basic.png │ │ │ │ ├── popout.png │ │ │ │ ├── toast.png │ │ │ │ ├── toast_basic.png │ │ │ │ ├── toast_error.png │ │ │ │ ├── toast_info.png │ │ │ │ ├── toast_success.png │ │ │ │ ├── toast_warning.png │ │ │ │ └── tooltip.png │ │ ├── settings.md │ │ └── ui.md │ ├── index.md │ ├── intermediate │ │ ├── bundling.md │ │ ├── img │ │ │ ├── plugin_card.png │ │ │ ├── plugin_modal.png │ │ │ └── plugin_settings.png │ │ └── react.md │ └── introduction │ │ ├── environment.md │ │ ├── guidelines.md │ │ ├── quick-start.md │ │ └── structure.md ├── public │ ├── branding │ │ ├── backdrop.png │ │ ├── changelogtemplate.xcf │ │ ├── invitebanner.png │ │ ├── logo_large.jpeg │ │ ├── logo_large.png │ │ ├── logo_large.svg │ │ ├── logo_large_black.png │ │ ├── logo_small.jpeg │ │ ├── logo_small.png │ │ ├── logo_small.svg │ │ ├── logo_solid.png │ │ ├── logo_solid_transparent.png │ │ ├── logo_very_small.png │ │ ├── serverbanner.png │ │ └── split.png │ └── favicon │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── manifest.json │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png ├── themes │ ├── advanced │ │ ├── performance.md │ │ └── preprocessing.md │ ├── basics │ │ ├── creating.md │ │ ├── img │ │ │ ├── caniuse.png │ │ │ └── guild_list.png │ │ ├── process.md │ │ └── selectors.md │ ├── index.md │ ├── intermediate │ │ ├── accessibility.md │ │ ├── img │ │ │ ├── backdrop_filter.png │ │ │ ├── github_branch.png │ │ │ ├── github_deploy.png │ │ │ ├── github_live.png │ │ │ ├── github_pages.png │ │ │ └── github_tabs.png │ │ ├── remote.md │ │ ├── transparency.md │ │ └── user.md │ └── introduction │ │ ├── environment.md │ │ ├── guidelines.md │ │ ├── quick-start.md │ │ └── structure.md └── users │ ├── getting-started │ ├── configuration.md │ ├── faq.md │ ├── img │ │ ├── agreement_text.png │ │ ├── bd_settings_tabs.png │ │ ├── installer.png │ │ └── programdata.gif │ ├── installation.md │ └── troubleshooting.md │ ├── guides │ ├── img │ │ └── addon_card.png │ ├── installing-addons.md │ └── vanilla.md │ └── index.md ├── eslint.config.js ├── package-lock.json ├── package.json ├── scripts ├── apigen.ts ├── data │ └── jsdoc-ast.json ├── eslint.config.js ├── parseast.ts └── types.d.ts └── tsconfig.json /.github/workflows/build-and-deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to GitHub Pages 2 | 3 | # Auto generate on a push to main, also allow manually triggering 4 | on: 5 | push: 6 | branches: 7 | - main 8 | workflow_dispatch: 9 | 10 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 11 | permissions: 12 | contents: read 13 | pages: write 14 | id-token: write 15 | 16 | 17 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 18 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 19 | concurrency: 20 | group: pages 21 | cancel-in-progress: false 22 | 23 | 24 | jobs: 25 | build: 26 | name: Build 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout 30 | uses: actions/checkout@v4 31 | with: 32 | fetch-depth: 0 # Not needed if lastUpdated is not enabled 33 | 34 | - name: Use Node.js 20 35 | uses: actions/setup-node@v4 36 | with: 37 | node-version: 20 38 | cache: npm 39 | 40 | - name: Setup Pages 41 | uses: actions/configure-pages@v4 42 | 43 | - name: Install Dependencies 44 | run: npm ci 45 | 46 | - name: Build Documentation 47 | run: npm run build 48 | 49 | - name: Upload Artifact 50 | uses: actions/upload-pages-artifact@v3 51 | with: 52 | path: .vitepress/dist 53 | 54 | 55 | # Deployment job 56 | deploy: 57 | environment: 58 | name: github-pages 59 | url: ${{ steps.deployment.outputs.page_url }} 60 | needs: build 61 | runs-on: ubuntu-latest 62 | name: Deploy 63 | steps: 64 | - name: Deploy to GitHub Pages 65 | id: deployment 66 | uses: actions/deploy-pages@v4 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | .vitepress/dist 6 | 7 | # Generated files 8 | .cache-loader 9 | .vitepress/cache 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /.vitepress/theme/index.ts: -------------------------------------------------------------------------------- 1 | import DefaultTheme from "vitepress/theme"; 2 | import "./custom.css"; 3 | import "virtual:group-icons.css"; 4 | 5 | 6 | export default DefaultTheme; -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to BetterDiscord 2 | 3 | Thanks for taking the time to contribute! 4 | 5 | The following is a set of guidelines for contributing to BetterDiscord. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. These guidelines have been adapted from [Atom](https://github.com/atom/atom/blob/master/CONTRIBUTING.md). 6 | 7 | 8 | ## Code of Conduct 9 | 10 | See our [Code of Conduct](https://github.com/BetterDiscord/BetterDiscord/blob/main/CODE_OF_CONDUCT.md) page for details. 11 | 12 | ## What should I know before I get started? 13 | 14 | Review the project architecture found on the [README](./README.md) and familiarize yourself with the layout. Then check the [`package.json`](./package.json) to get familiar with the tech stack in use. 15 | 16 | ## How Can I Contribute? 17 | 18 | ### Reporting Bugs 19 | 20 | This section guides you through submitting a bug report for BetterDiscord. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. 21 | 22 | Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. 23 | 24 | #### Before Submitting A Bug Report 25 | 26 | * **Perform a [search](https://github.com/BetterDiscord/docs/issues)** to see if the problem has already been reported. If it has **and the issue is still open**, add a :+1: to the existing issue instead of opening a new one. 27 | 28 | #### How Do I Submit A (Good) Bug Report? 29 | 30 | Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined this is a new bug using the steps from above, create an issue and provide the following information. 31 | 32 | * **Use a clear and descriptive title** for the issue to identify the problem. 33 | * **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started Discord, e.g. which addons exactly you used, and what actions were taken. When listing steps, **don't just say what you did, but explain how you did it**. For example, if you opened a menu, explain if you used the mouse, or a keyboard shortcut or something else entirely. 34 | * **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). 35 | * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. 36 | * **Explain which behavior you expected to see instead and why.** 37 | * **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. 38 | 39 | 40 | ### Suggesting Enhancements 41 | 42 | This section guides you through submitting an enhancement suggestion for BetterDiscord, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions. 43 | 44 | Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in the details including the steps that you imagine you would take if the feature you're requesting existed. 45 | 46 | #### Before Submitting An Enhancement Suggestion 47 | 48 | * **Check if there's already a plugin which provides that enhancement.** 49 | * **Perform a [cursory search](https://guides.github.com/features/issues/)** to see if the enhancement has already been suggested. If it has, add a :+1: to the existing issue instead of opening a new one. 50 | 51 | #### How Do I Submit A (Good) Enhancement Suggestion? 52 | 53 | Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined this is a new suggestion using the steps from above, create an issue and provide the following information: 54 | 55 | * **Use a clear and descriptive title** for the issue to identify the suggestion. 56 | * **Provide a step-by-step description of the suggested enhancement** in as many details as possible. 57 | * **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). 58 | * **Describe the current behavior** and **explain which behavior you expected to see instead** and why. 59 | * **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of BetterDiscord which the suggestion is related to. 60 | * **Explain why this enhancement would be useful** to most BetterDiscord users and isn't something that can or should be implemented as a plugin. 61 | 62 | ### Your First Code Contribution 63 | 64 | > [!IMPORTANT] 65 | > If you've found typos, it's preferred to just open an issue rather than a single character pull request! 66 | 67 | Unsure where to begin contributing? You can start by looking through `help-wanted` issues or any issues labelled `can't reproduce`. 68 | 69 | ### Pull Requests 70 | 71 | Please follow these steps to have your contribution considered by the maintainers: 72 | 73 | 1. Use a pull request template, if one exists. 74 | 2. Follow the [styleguides](#styleguides) 75 | 3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing
What if the status checks are failing?If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.
76 | 77 | While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. 78 | 79 | ### Translations 80 | 81 | Currently, the documentation is only available in English. 82 | 83 | ## Styleguides 84 | 85 | ### Git Commit Messages 86 | 87 | * Use the present tense ("Add feature" not "Added feature") 88 | * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") 89 | * Limit the first line to 72 characters or less 90 | * Reference issues and pull requests liberally after the first line 91 | * When only changing documentation, include `[ci skip]` in the commit title 92 | 93 | ### TypeScript Styleguide 94 | 95 | All TypeScript must adhere to the [ESLint rules](https://github.com/BetterDiscord/docs/blob/main/eslint.config.js) of the repo. 96 | 97 | Some other style related points not covered by ESLint: 98 | 99 | * Use verbose variable names 100 | * Prefer to use react patches over DOM manipulation when possible 101 | * Prefer to use separate components from Discord when possible 102 | * Inline `export`s with expressions whenever possible 103 | ```js 104 | // Use this: 105 | export default class ClassName { 106 | 107 | } 108 | 109 | // Instead of: 110 | class ClassName { 111 | 112 | } 113 | export default ClassName 114 | ``` 115 | * Place class properties in the following order: 116 | * Class methods and properties (methods starting with `static`) 117 | * Instance methods and properties 118 | * Place requires in the following order: 119 | * Built in Node Modules (such as `path`) 120 | * Repo level global imports (such as `modules`, `builtins`) 121 | * Local Modules (using relative paths) 122 | * Prefer to import whole modules instead of singular functions 123 | * Keep modules namespaced and organized 124 | * This includes Node Modules (such as `fs`) 125 | ```js 126 | const fs = require("fs"); // Use this 127 | const {readFile, writeFile} = require("fs"); // Avoid this 128 | 129 | import Utilities from "./utilities"; // Use this 130 | import {deepclone, isEmpty} from "./utilties"; // Avoid this 131 | ``` 132 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | [build-badge]: https://img.shields.io/github/actions/workflow/status/BetterDiscord/docs/build-and-deploy.yml?branch=main&logo=Github&logoColor=3a71c1&labelColor=0c0d10&color=3a71c1&style=for-the-badge 4 | [build-link]: https://github.com/BetterDiscord/docs/actions/workflows/build-and-deploy.yml 5 | 6 | [downloads-badge]: https://img.shields.io/github/downloads/BetterDiscord/Installer/total?labelColor=0c0d10&color=3a71c1&style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyLjI1IDM4LjVIMzUuNzVDMzYuNzE2NSAzOC41IDM3LjUgMzkuMjgzNSAzNy41IDQwLjI1QzM3LjUgNDEuMTY4MiAzNi43OTI5IDQxLjkyMTIgMzUuODkzNSA0MS45OTQyTDM1Ljc1IDQySDEyLjI1QzExLjI4MzUgNDIgMTAuNSA0MS4yMTY1IDEwLjUgNDAuMjVDMTAuNSAzOS4zMzE4IDExLjIwNzEgMzguNTc4OCAxMi4xMDY1IDM4LjUwNThMMTIuMjUgMzguNUgzNS43NUgxMi4yNVpNMjMuNjA2NSA2LjI1NThMMjMuNzUgNi4yNUMyNC42NjgyIDYuMjUgMjUuNDIxMiA2Ljk1NzExIDI1LjQ5NDIgNy44NTY0N0wyNS41IDhWMjkuMzMzTDMwLjI5MzEgMjQuNTQwN0MzMC45NzY1IDIzLjg1NzMgMzIuMDg0NiAyMy44NTczIDMyLjc2OCAyNC41NDA3QzMzLjQ1MTQgMjUuMjI0MiAzMy40NTE0IDI2LjMzMjIgMzIuNzY4IDI3LjAxNTZMMjQuOTg5OCAzNC43OTM4QzI0LjMwNjQgMzUuNDc3MiAyMy4xOTg0IDM1LjQ3NzIgMjIuNTE1IDM0Ljc5MzhMMTQuNzM2OCAyNy4wMTU2QzE0LjA1MzQgMjYuMzMyMiAxNC4wNTM0IDI1LjIyNDIgMTQuNzM2OCAyNC41NDA3QzE1LjQyMDIgMjMuODU3MyAxNi41MjgyIDIzLjg1NzMgMTcuMjExNyAyNC41NDA3TDIyIDI5LjMyOVY4QzIyIDcuMDgxODMgMjIuNzA3MSA2LjMyODgxIDIzLjYwNjUgNi4yNTU4TDIzLjc1IDYuMjVMMjMuNjA2NSA2LjI1NThaIiBmaWxsPSIjM2E3MWMxIi8+Cjwvc3ZnPgo= 7 | [downloads-link]: #auto-installers 8 | 9 | [discord-badge]: https://img.shields.io/badge/discord-green?labelColor=0c0d10&color=7289da&style=for-the-badge&logo=discord&logoColor=7289da 10 | [discord-link]: https://discord.gg/bnSUxedypU 11 | 12 | [website-badge]: https://img.shields.io/badge/website-green?labelColor=0c0d10&color=3a71c1&style=for-the-badge&logo=firefoxbrowser&logoColor=3a71c1 13 | [website-link]: https://betterdiscord.app 14 | 15 | [docs-badge]: https://img.shields.io/badge/docs-green?labelColor=0c0d10&color=3a71c1&style=for-the-badge&logo=readthedocs&logoColor=3a71c1 16 | [docs-link]: https://docs.betterdiscord.app 17 | 18 | 19 | # BetterDiscord Docs 20 | 21 | [![CI Status][build-badge]][build-link] [![GitHub Releases][downloads-badge]][downloads-link] [![Discord][discord-badge]][discord-link] [![Website][website-badge]][website-link] [![Docs][docs-badge]][docs-link] 22 | 23 | [![Theme Split](https://betterdiscord.app/resources/branding/serverbanner.png)](https://docs.betterdiscord.app/) 24 | 25 |
26 | 27 | 28 | # About 29 | 30 | The docs website is built using [VitePress](https://vitepress.dev/), a modern static website generator purpose built for documentation. The documentation itself is stored in markdown format using as little Vue components as possible in order to maximize the plaintext readability both for local viewing in an IDE as well as those that want to read the docs through GitHub rather than the website. 31 | 32 | # Docs Structure 33 | 34 | This is the current documentation structure for the markdown files. It covers a wide range of topics and each entry below has several subpages with detailed information. 35 | 36 | ``` 37 | . 38 | ├──User Guides // Basic walkthroughs for the average end-user 39 | ├──Developer Guides // General set of guides useful for all developers 40 | | ├──Plugins // Walkthroughs and information for plugin developers 41 | | └──Themes // Informational guide to create themes for BetterDiscord 42 | └──API Reference // Non-walkthrough API reference 43 | ├──BetterDiscord API // Detailed reference of everything available on BdApi 44 | └──Discord // Advanced info on Discord's internals (subject to change) 45 | ``` 46 | 47 | The markdown pages under BetterDiscord API (aside from the overview/index) are automatically generated via a pair of scripts to extract the JSDoc from BetterDiscord and process it into markdown. 48 | 49 | 50 | # Project Structure 51 | 52 | ``` 53 | . 54 | ├──.vitepress // VitePress folder for config and customization 55 | | └──theme // Extension of the default theme 56 | ├──docs // All the markdown documentation 57 | | ├──public // Static assets available at url root 58 | | └── // See the structure above 59 | └──scripts // Helper scripts to generate the api reference 60 | 61 | ``` 62 | 63 | # Contributors 64 | 65 | For information on contributing to this project, please see [CONTRIBUTING.md](/CONTRIBUTING.md). 66 | 67 | [![Contributors][contributors-image]][contributors-link] 68 | 69 | [contributors-image]: https://contrib.rocks/image?repo=betterdiscord/docs 70 | [contributors-link]: https://github.com/betterdiscord/docs/graphs/contributors -------------------------------------------------------------------------------- /docs/api/addonapi.md: -------------------------------------------------------------------------------- 1 | # AddonAPI 2 | 3 | `AddonAPI` is a utility class for working with plugins and themes. Instances are accessible through the [BdApi](./bdapi). 4 | 5 | ## Properties 6 | 7 | ### folder 8 | The path to the addon folder. 9 | 10 | **Type:** `string` 11 | ___ 12 | 13 | 14 | ## Methods 15 | 16 | ### disable 17 | Disables the given addon. 18 | 19 | | Parameter | Type | Description | 20 | |:----------|:------:|:----------------------:| 21 | idOrFile|string|Addon ID or filename 22 | 23 | **Returns:** `void` 24 | ___ 25 | 26 | ### enable 27 | Enables the given addon. 28 | 29 | | Parameter | Type | Description | 30 | |:----------|:------:|:----------------------:| 31 | idOrFile|string|Addon ID or filename 32 | 33 | **Returns:** `void` 34 | ___ 35 | 36 | ### get 37 | Gets a particular addon. 38 | 39 | | Parameter | Type | Description | 40 | |:----------|:------:|:----------------------:| 41 | idOrFile|string|Addon ID or filename 42 | 43 | **Returns:** `object` - Addon instance 44 | ___ 45 | 46 | ### getAll 47 | Gets all addons of this type. 48 | 49 | 50 | **Returns:** `Array.` - Array of all addon instances 51 | ___ 52 | 53 | ### isEnabled 54 | Determines if a particular addon is enabled. 55 | 56 | | Parameter | Type | Description | 57 | |:----------|:------:|:----------------------:| 58 | idOrFile|string|Addon ID or filename 59 | 60 | **Returns:** `boolean` 61 | ___ 62 | 63 | ### reload 64 | Reloads if a particular addon is enabled. 65 | 66 | | Parameter | Type | Description | 67 | |:----------|:------:|:----------------------:| 68 | idOrFile|string|Addon ID or filename 69 | 70 | **Returns:** `void` 71 | ___ 72 | 73 | ### toggle 74 | Toggles if a particular addon is enabled. 75 | 76 | | Parameter | Type | Description | 77 | |:----------|:------:|:----------------------:| 78 | idOrFile|string|Addon ID or filename 79 | 80 | **Returns:** `void` 81 | ___ 82 | -------------------------------------------------------------------------------- /docs/api/components.md: -------------------------------------------------------------------------------- 1 | # Components 2 | 3 | `Components` is a namespace holding a series of React components. It is available under [BdApi](./bdapi). 4 | 5 | > [!NOTE] 6 | > This documentation is in progress and currently just serves as a reference list with no additional info. 7 | 8 | ## Properties 9 | 10 | ### Button 11 | 12 | 13 | ### ColorInput 14 | 15 | 16 | ### DropdownInput 17 | 18 | 19 | ### ErrorBoundary 20 | 21 | 22 | ### Flex 23 | 24 | 25 | ### KeybindInput 26 | 27 | 28 | ### NumberInput 29 | 30 | 31 | ### RadioInput 32 | 33 | 34 | ### SearchInput 35 | 36 | 37 | ### SettingGroup 38 | 39 | 40 | ### SettingItem 41 | 42 | 43 | ### SliderInput 44 | 45 | 46 | ### SwitchInput 47 | 48 | 49 | ### Text 50 | 51 | 52 | ### TextInput 53 | 54 | 55 | ### Tooltip 56 | 57 | 58 | ## Methods 59 | 60 | -------------------------------------------------------------------------------- /docs/api/contextmenu.md: -------------------------------------------------------------------------------- 1 | # ContextMenu 2 | 3 | `ContextMenu` is a module to help patch and create context menus. Instance is accessible through the [BdApi](./bdapi). 4 | 5 | ## Properties 6 | 7 | 8 | 9 | ## Methods 10 | 11 | ### buildItem 12 | Builds a single menu item. The only prop shown here is the type, the rest should match the actual component being built. View those to see what options exist for each, they often have less in common than you might think. 13 | 14 | | Parameter | Type | Optional | Default | Description | 15 | |:----------|:------:|:--------:|:-------:|:----------------------:| 16 | props|object|❌|*none*|Props used to build the item 17 | props.type|string|✅|"text"|Type of the item, options: text, submenu, toggle, radio, custom, separator 18 | 19 | **Returns:** `object` - The created component 20 | ___ 21 | 22 | ### buildMenu 23 | Creates the menu *component* including the wrapping `ContextMenu`. Calls {@link ContextMenu.buildMenuChildren} under the covers. Used to call in combination with {@link ContextMenu.open}. 24 | 25 | | Parameter | Type | Description | 26 | |:----------|:------:|:----------------------:| 27 | setup|Array.<object>|Array of item props used to build items. See {@link ContextMenu.buildMenuChildren}. 28 | 29 | **Returns:** `function` - The unique context menu component 30 | ___ 31 | 32 | ### buildMenuChildren 33 | Creates the all the items **and groups** of a context menu recursively. There is no hard limit to the number of groups within groups or number of items in a menu. 34 | 35 | | Parameter | Type | Description | 36 | |:----------|:------:|:----------------------:| 37 | setup|Array.<object>|Array of item props used to build items. See {@link ContextMenu.buildItem}. 38 | 39 | **Returns:** `Array.` - Array of the created component 40 | ___ 41 | 42 | ### close 43 | Closes the current opened context menu immediately. 44 | 45 | 46 | **Returns:** `void` 47 | ___ 48 | 49 | ### open 50 | Function that allows you to open an entire context menu. Recommended to build the menu with this module. 51 | 52 | | Parameter | Type | Optional | Default | Description | 53 | |:----------|:------:|:--------:|:-------:|:----------------------:| 54 | event|MouseEvent|❌|*none*|The context menu event. This can be emulated, requires target, and all X, Y locations. 55 | menuComponent|function|❌|*none*|Component to render. This can be any React component or output of {@link ContextMenu.buildMenu}. 56 | config|object|❌|*none*|Configuration/props for the context menu 57 | config.position|string|✅|"right"|Default position for the menu, options: "left", "right" 58 | config.align|string|✅|"top"|Default alignment for the menu, options: "bottom", "top" 59 | config.onClose|function|✅|*none*|Function to run when the menu is closed 60 | 61 | **Returns:** `void` 62 | ___ 63 | 64 | ### patch 65 | Allows you to patch a given context menu. Acts as a wrapper around the `Patcher`. 66 | 67 | | Parameter | Type | Description | 68 | |:----------|:------:|:----------------------:| 69 | navId|string|Discord's internal `navId` used to identify context menus 70 | callback|function|Callback function that accepts the React render tree 71 | 72 | **Returns:** `function` - A function that automatically unpatches 73 | ___ 74 | 75 | ### unpatch 76 | Allows you to remove the patch added to a given context menu. 77 | 78 | | Parameter | Type | Description | 79 | |:----------|:------:|:----------------------:| 80 | navId|string|The original `navId` from patching 81 | callback|function|The original callback from patching 82 | 83 | **Returns:** `void` 84 | ___ 85 | -------------------------------------------------------------------------------- /docs/api/data.md: -------------------------------------------------------------------------------- 1 | # Data 2 | 3 | `Data` is a simple utility class for the management of plugin data. An instance is available on [BdApi](./bdapi). 4 | 5 | ## Properties 6 | 7 | 8 | 9 | ## Methods 10 | 11 | ### delete 12 | Deletes a piece of stored data. This is different than saving `null` or `undefined`. 13 | 14 | | Parameter | Type | Description | 15 | |:----------|:------:|:----------------------:| 16 | pluginName|string|Name of the plugin deleting data 17 | key|string|Which piece of data to delete. 18 | 19 | **Returns:** `void` 20 | ___ 21 | 22 | ### load 23 | Loads previously stored data. 24 | 25 | | Parameter | Type | Description | 26 | |:----------|:------:|:----------------------:| 27 | pluginName|string|Name of the plugin loading data 28 | key|string|Which piece of data to load 29 | 30 | **Returns:** `any` - The stored data 31 | ___ 32 | 33 | ### save 34 | Saves JSON-serializable data. 35 | 36 | | Parameter | Type | Description | 37 | |:----------|:------:|:----------------------:| 38 | pluginName|string|Name of the plugin saving data 39 | key|string|Which piece of data to store 40 | data|any|The data to be saved 41 | 42 | **Returns:** `void` 43 | ___ 44 | -------------------------------------------------------------------------------- /docs/api/dom.md: -------------------------------------------------------------------------------- 1 | # DOM 2 | 3 | `DOM` is a simple utility class for dom manipulation. An instance is available on [BdApi](./bdapi). 4 | 5 | ## Properties 6 | 7 | ### screenHeight 8 | Current height of the user's screen. 9 | 10 | **Type:** `number` 11 | ___ 12 | 13 | ### screenWidth 14 | Current width of the user's screen. 15 | 16 | **Type:** `number` 17 | ___ 18 | 19 | 20 | ## Methods 21 | 22 | ### addStyle 23 | Adds a `