Skip to content

Instantly share code, notes, and snippets.

@rauenzi
Last active August 7, 2022 06:37
Show Gist options
  • Save rauenzi/e5f4d02fc3085a53872b0236cd6f8225 to your computer and use it in GitHub Desktop.
Save rauenzi/e5f4d02fc3085a53872b0236cd6f8225 to your computer and use it in GitHub Desktop.
Plugin template for BetterDiscord v1
/**
* @name ExamplePlugin
* @author YourName
* @description Describe the basic functions. Maybe a support server link.
* @version 0.0.1
* @invite inviteCode
* @authorId 51512151151651
* @authorLink https://twitter.com/Whoever
* @donate https://paypal.me/
* @patreon https://patreon.com/
* @website https://github.com/rauenzi/BetterDiscordApp
* @source https://gist.github.com/rauenzi/e5f4d02fc3085a53872b0236cd6f8225
*/
module.exports = class ExamplePlugin {
load() {} // Optional function. Called when the plugin is loaded in to memory
start() {} // Required function. Called when the plugin is activated (including after reloads)
stop() {} // Required function. Called when the plugin is deactivated
observer(changes) {} // Optional function. Observer for the `document`. Better documentation than I can provide is found here: <https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver>
}
@12944qwerty
Copy link

@avocado5182 I'm getting this error when I try enabling it

image

@3xnn
Copy link

3xnn commented Sep 3, 2021

@avocado5182
BdApi.showToast() is the only toast.
/**

module.exports = class CreationDates {
start() {
BdApi.showToast("CreationDates plugin loaded!", {type:"success", icon: true});
}

stop() {
    BdApi.showToast("CreationDates plugin stopped.", {type:"info", icon: true});
}

};

@3xnn
Copy link

3xnn commented Sep 3, 2021

Oh also now its modules.export I'm pretty sure.

@k26pl
Copy link

k26pl commented Mar 4, 2022

it is module.exports
in es6 there is export default x or export {y,z}, but es6 modules and require() are not compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment