mirror of
https://github.com/sern-handler/awesome-plugins
synced 2026-06-24 00:32:21 +00:00
chore: Update JavaScript plugins (#69)
chore: update JavaScript plugins Co-authored-by: EvolutionX-10 <EvolutionX-10@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
98ab449203
commit
b2ee0996f1
@@ -17,22 +17,17 @@
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
import { PluginType } from "@sern/handler";
|
||||
import { CommandControlPlugin, controller } from "@sern/handler";
|
||||
export function dmOnly(content, ephemeral) {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
description: "Allows commands to be run in DM only",
|
||||
// For discord.js you should have the Partials.Channel and DirectMessages intent enabled.
|
||||
return CommandControlPlugin(async (ctx, _) => {
|
||||
if (ctx.channel?.isDMBased()) return controller.next();
|
||||
if (content)
|
||||
await ctx.reply({
|
||||
content,
|
||||
ephemeral,
|
||||
}); // Change this if you want or remove it for silent deny
|
||||
|
||||
async execute(event, controller) {
|
||||
const [ctx] = event;
|
||||
if (ctx.channel?.isDMBased()) return controller.next();
|
||||
if (content)
|
||||
await ctx.reply({
|
||||
content,
|
||||
ephemeral,
|
||||
}); // Change this if you want or remove it for silent deny
|
||||
|
||||
return controller.stop();
|
||||
},
|
||||
};
|
||||
return controller.stop();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user