mirror of
https://github.com/sern-handler/sern-community
synced 2026-06-28 02:32:19 +00:00
refactor: pretty imports (#24)
This commit is contained in:
5
src/plugins/index.ts
Normal file
5
src/plugins/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from "./channelOnly.js";
|
||||
export * from "./cooldown.js";
|
||||
export * from "./ownerOnly.js";
|
||||
export * from "./publish.js";
|
||||
export * from "./refreshCache.js";
|
||||
@@ -1,20 +1,18 @@
|
||||
import { CommandType, EventPlugin, PluginType } from "@sern/handler";
|
||||
export const ownerIDs = [
|
||||
"697795666373640213",
|
||||
"182326315813306368",
|
||||
"756393473430519849",
|
||||
];
|
||||
import { ownerIDs } from "#constants";
|
||||
|
||||
export function ownerOnly(override?: string[]): EventPlugin<CommandType.Both> {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
description: "Allows only bot owner to run command",
|
||||
async execute(event, controller) {
|
||||
const [ctx] = event;
|
||||
if ((override ?? ownerIDs).includes(ctx.user.id)) return controller.next();
|
||||
if ((override ?? ownerIDs).includes(ctx.user.id))
|
||||
return controller.next();
|
||||
await ctx.reply({
|
||||
content: 'Not for you!',
|
||||
ephemeral: true
|
||||
})
|
||||
content: "Not for you!",
|
||||
ephemeral: true,
|
||||
});
|
||||
return controller.stop();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user