fix-add async to plugin (#88)

This commit is contained in:
Gary
2023-04-29 12:05:56 -05:00
committed by GitHub
parent ff40182008
commit 49db76219e

View File

@@ -3,7 +3,7 @@
* This is OwnerOnly plugin, it allows only bot owners to run the command, like eval.
*
* @author @EvolutionX-10 [<@697795666373640213>]
* @version 1.0.0
* @version 1.1.0
* @example
* ```ts
* import { ownerOnly } from "../plugins/ownerOnly";
@@ -20,7 +20,7 @@
import { CommandType, CommandControlPlugin, controller } from "@sern/handler";
const ownerIDs = ["697795666373640213"]; //! Fill your ID
export function ownerOnly() {
return CommandControlPlugin<CommandType.Both>((ctx, args) => {
return CommandControlPlugin<CommandType.Both>(async (ctx, args) => {
if (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!!!");