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:
github-actions[bot]
2022-09-25 09:35:01 +05:30
committed by GitHub
parent 33416d246d
commit c7daa476a8
3 changed files with 81 additions and 23 deletions

View File

@@ -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();
},
};
}