From 16328c9b4a861f305b7148b4c46abf10b2ea86eb Mon Sep 17 00:00:00 2001 From: Evo <85353424+EvolutionX-10@users.noreply.github.com> Date: Mon, 1 May 2023 02:53:04 +0530 Subject: [PATCH] chore: update owneronly plugin (#90) --- TypeScript/ownerOnly.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TypeScript/ownerOnly.ts b/TypeScript/ownerOnly.ts index 3c44657..c6e9305 100644 --- a/TypeScript/ownerOnly.ts +++ b/TypeScript/ownerOnly.ts @@ -3,13 +3,13 @@ * This is OwnerOnly plugin, it allows only bot owners to run the command, like eval. * * @author @EvolutionX-10 [<@697795666373640213>] - * @version 1.1.0 + * @version 1.2.0 * @example * ```ts * import { ownerOnly } from "../plugins/ownerOnly"; * import { commandModule } from "@sern/handler"; * export default commandModule({ - * plugins: [ ownerOnly() ], + * plugins: [ ownerOnly() ], // can also pass array of IDs to override default owner IDs * execute: (ctx) => { * //your code here * } @@ -19,9 +19,9 @@ import { CommandType, CommandControlPlugin, controller } from "@sern/handler"; const ownerIDs = ["697795666373640213"]; //! Fill your ID -export function ownerOnly() { - return CommandControlPlugin(async (ctx, args) => { - if (ownerIDs.includes(ctx.user.id)) return controller.next(); +export function ownerOnly(override?: string[]) { + return CommandControlPlugin((ctx) => { + if ((override ?? ownerIDs).includes(ctx.user.id)) return controller.next(); //* If you want to reply when the command fails due to user not being owner, you can use following // await ctx.reply("Only owner can run it!!!"); return controller.stop(); //! Important: It stops the execution of command!