Examples
Simple Notification Plugin
A beginner-level Plexcord plugin that shows a welcome notification when installed. Learn the bare minimum of a working plugin.
Example: Simple Notification Plugin
Difficulty: Beginner | Concepts: definePlugin, start(), showNotification
This is the simplest possible "real" plugin; it shows a notification when Discord starts with Plexcord loaded. Perfect for understanding the minimum structure of a plugin.
Full Source
// File: src/plugins/myFirstPlugin/index.ts
import definePlugin from "@utils/types";
import { showNotification } from "@api/Notifications";
export default definePlugin({
name: "MyFirstPlugin",
description: "Shows a welcome notification when Discord starts",
authors: [
{
name: "YourName",
id: 0n // Replace with your Discord user ID as BigInt
}
],
start() {
showNotification({
title: "Plexcord is running!",
body: "Your plugin is active. Happy hacking 🎉",
color: "#43B581"
});
}
});How It Works
definePluginwraps your plugin definition, providing TypeScript intellisense and type safety.start()is called once when the plugin is enabled, either at Discord startup or when you toggle it on.showNotificationdisplays a pop-up in the corner of Discord.
Variations to Try
Add a stop action
stop() {
showNotification({
title: "Plugin Disabled",
body: "MyFirstPlugin has been turned off.",
color: "#ED4245"
});
}Make it a toast instead
import { showToast, Toasts } from "@api/Notifications";
start() {
showToast("Plugin loaded!", Toasts.Type.SUCCESS);
}