mirror of
https://github.com/sern-handler/awesome-plugins
synced 2026-06-27 18:22:17 +00:00
chore: Update JavaScript plugins (#47)
chore: update JavaScript plugins Co-authored-by: EvolutionX-10 <EvolutionX-10@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
33416d246d
commit
c7daa476a8
@@ -22,22 +22,22 @@
|
||||
import { CommandType, EventPlugin, PluginType } from "@sern/handler";
|
||||
|
||||
export function serverOnly(
|
||||
guildId: string[],
|
||||
failMessage = "I am unable to comply with your command."
|
||||
guildId: string[],
|
||||
failMessage = "I am unable to comply with your command."
|
||||
): EventPlugin<CommandType.Both> {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
description: "Checks if a command is available in a specific server.",
|
||||
async execute([ctx, args], controller) {
|
||||
if (!guildId.includes(ctx.guildId)) {
|
||||
await ctx.reply(failMessage).then(async (m) => {
|
||||
setTimeout(async () => {
|
||||
await m.delete();
|
||||
}, 3000);
|
||||
});
|
||||
return controller.stop();
|
||||
}
|
||||
return controller.next();
|
||||
},
|
||||
};
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
description: "Checks if a command is available in a specific server.",
|
||||
async execute([ctx, args], controller) {
|
||||
if (!guildId.includes(ctx.guildId)) {
|
||||
await ctx.reply(failMessage).then(async (m) => {
|
||||
setTimeout(async () => {
|
||||
await m.delete();
|
||||
}, 3000);
|
||||
});
|
||||
return controller.stop();
|
||||
}
|
||||
return controller.next();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user