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>
}
@GilEdit
Copy link

GilEdit commented Jul 22, 2020

Muito bom

@Tropix126
Copy link

nice plugin

@ATmel91
Copy link

ATmel91 commented Dec 12, 2020

thank you

@owocean
Copy link

owocean commented Dec 30, 2020

gg

@optionsx
Copy link

my journey begins ;p

@marcos10pc
Copy link

my journey begins ;p

My too

@marcos10pc
Copy link

it dont works

@avocado5182
Copy link

Yea the plugin template doesn't even work. It errors saying (0, e.exports) is not a constructor. Here is my full code (taken from this gist):

/**
 * @name CreationDates
 * @version 0.0.1
 * @description Right click on users, messages, reactions, etc to get their creation date (based on id).
 * @author avocado
 */

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

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

@rauenzi
Copy link
Author

rauenzi commented Apr 9, 2021

Try reloading with ctrl+r. Also showToast is not defined there

@t4ngentt
Copy link

alr lets see if we can make something

@LuminousHD
Copy link

my journey begins ;p

same here UwU

@migue802
Copy link

it dont works

Because it's a template with no functions?

@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