chore: lol

permalink: http://whatthecommit.com/59bcc3ad6775562f845953cf01624225
This commit is contained in:
EvolutionX
2022-09-21 06:37:45 +05:30
parent 6480f1725d
commit a5d1f33fb1
2 changed files with 39 additions and 40 deletions

View File

@@ -22,14 +22,11 @@ jobs:
- name: Install Node.js dependencies
run: npm i -g prettier && npm i
- name: Run Prettier
run: prettier --write .
- name: Convert TypeScript to JavaScript
run: npx babel TypeScript --out-dir JavaScript --extensions ".ts"
- name: Run JavaScript Prettier
run: prettier --write ./JavaScript
run: prettier --write .
- name: Create Pull Request
id: cpr

View File

@@ -1,36 +1,38 @@
// @ts-nocheck
/**
* Disables a command entirely, for whatever reasons you may need.
*
* @author @jacoobes [<@182326315813306368>]
* @version 1.0.0
* @example
* ```ts
* import { disable } from "../plugins/disable";
* import { commandModule } from "@sern/handler";
* export default commandModule({
* plugins: [ disable() ],
* execute: (ctx) => {
* //your code here
* }
* })
* ```
*/
import { CommandType, EventPlugin, PluginType } from "@sern/handler";
import { InteractionReplyOptions, ReplyMessageOptions } from "discord.js";
export function disable(
onFail?: string | Omit<InteractionReplyOptions, "fetchReply"> | ReplyMessageOptions
): EventPlugin<CommandType.Both> {
return {
type: PluginType.Event,
description: "Disables command from responding",
async execute([ctx], controller) {
if(onFail !== undefined) {
await ctx.reply(onFail);
}
return controller.stop();
}
};
}
// @ts-nocheck
/**
* Disables a command entirely, for whatever reasons you may need.
*
* @author @jacoobes [<@182326315813306368>]
* @version 1.0.0
* @example
* ```ts
* import { disable } from "../plugins/disable";
* import { commandModule } from "@sern/handler";
* export default commandModule({
* plugins: [ disable() ],
* execute: (ctx) => {
* //your code here
* }
* })
* ```
*/
import { CommandType, EventPlugin, PluginType } from "@sern/handler";
import { InteractionReplyOptions, ReplyMessageOptions } from "discord.js";
export function disable(
onFail?:
| string
| Omit<InteractionReplyOptions, "fetchReply">
| ReplyMessageOptions
): EventPlugin<CommandType.Both> {
return {
type: PluginType.Event,
description: "Disables command from responding",
async execute([ctx], controller) {
if (onFail !== undefined) {
await ctx.reply(onFail);
}
return controller.stop();
},
};
}