mirror of
https://github.com/sern-handler/awesome-plugins
synced 2026-06-27 18:22:17 +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
@@ -22,21 +22,21 @@
|
||||
import { CommandType, controller, CommandControlPlugin } from "@sern/handler";
|
||||
|
||||
export function serverOnly(
|
||||
guildId: string[],
|
||||
failMessage = "This command is not available in this guild. \nFor permission to use in your server, please contact my developer."
|
||||
guildId: string[],
|
||||
failMessage = "This command is not available in this guild. \nFor permission to use in your server, please contact my developer."
|
||||
) {
|
||||
return CommandControlPlugin<CommandType.Both>(async ( ctx, _) => {
|
||||
if(ctx.guildId == null) {
|
||||
return controller.stop()
|
||||
}
|
||||
if (!guildId.includes(ctx.guildId)) {
|
||||
ctx.reply(failMessage).then(async (m) => {
|
||||
setTimeout(async () => {
|
||||
await m.delete();
|
||||
}, 3000);
|
||||
});
|
||||
return controller.stop();
|
||||
}
|
||||
return controller.next();
|
||||
})
|
||||
return CommandControlPlugin<CommandType.Both>(async (ctx, _) => {
|
||||
if (ctx.guildId == null) {
|
||||
return controller.stop();
|
||||
}
|
||||
if (!guildId.includes(ctx.guildId)) {
|
||||
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