1 parent e580c49 commit 0f5792eCopy full SHA for 0f5792e
1 file changed
src/commands/test.ts
@@ -1,15 +1,23 @@
1
-import { Message } from "../types/message"
+import { Message } from "../types/message";
2
3
export const info = {
4
command: "test",
5
- description: "A simple test command.",
6
- usage: "test",
7
- example: "test",
8
- role: "user",
+ description:
+ "A simple test command with optional error to test error handling.",
+ usage: "test [--error]",
+ example: "test --error",
9
+ role: "admin",
10
cooldown: 5000,
11
};
12
13
export default async function (msg: Message): Promise<void> {
14
+ const match = /^test(?:\s+--error)?$/i.exec(msg.body.trim());
15
+ if (!match) return;
16
+
17
+ const error = msg.body.includes("--error");
18
19
+ if (error) throw Error("This is a test error");
20
21
const testMessage = `
22
\`Hello World\`
23
0 commit comments