Describe it with a manifest
Create a
manifest.json with at least the required fields. The manifest is the metadata Unbound uses to list, attribute, and validate your addon.manifest.json
main points at your entry file. id is the name you use everywhere else. See the manifest for the full field list.Write the entry point
Your
main file default-exports an object with optional start and stop hooks.- Unbound calls
startwhen the plugin is enabled. Set everything up here. - Unbound calls
stopwhen the plugin is disabled. Undo everythingstartdid.
index.ts
Find what you want to change
Use Metro to find the Discord module you need. Pass
{ lazy: true } so the search only runs the first time a property on it is accessed.Patch it
Wrap the function with the patcher. Create a patcher scoped to your plugin so you can revert all of its patches at once.
Remember a setting
Save configuration with storage. Create a store named after your plugin
id, then read and write keys on it. Values persist across reloads with no extra work.Clean up in stop
Revert everything when the plugin is disabled. A single
unpatchAll call undoes every patch the patcher made.The full plugin
All the steps combined into one file:index.ts
Where to go next
Patcher
The full patcher API: before, after, instead, and typing.
Patching Components
Change what Discord’s components render.
Flux Stores
Read Discord’s state and react to its events.
Debugging
Tools for developing and inspecting your addon.