chore: Update JavaScript plugins (#91)

chore: update JavaScript plugins

Co-authored-by: jacoobes <jacoobes@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-05-01 14:12:24 +05:30
committed by GitHub
parent 16328c9b4a
commit e617fdcefb
2 changed files with 8 additions and 6 deletions

View File

@@ -4,13 +4,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
* }
@@ -20,9 +20,10 @@
import { 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(); //* If you want to reply when the command fails due to user not being owner, you can use following
export function ownerOnly(override) {
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!