Skip to content

Commit 1db4d52

Browse files
committed
fix: command exec handler
1 parent dab1ecb commit 1db4d52

42 files changed

Lines changed: 74 additions & 158 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/commands/..ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ export const info = {
1212
};
1313

1414
export default async function (msg: Message): Promise<void> {
15-
if (!/^.$/.test(msg.body)) return;
16-
1715
if (!msg.hasQuotedMsg) {
1816
await msg.reply(
1917
"You need to reply to a message to rerun the commands again.",

src/commands/cat.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,5 @@ export const info = {
1111
};
1212

1313
export default async function (msg: Message): Promise<void> {
14-
if (!/^cat$/i.test(msg.body)) return;
15-
1614
await msg.reply(cat[Math.floor(Math.random() * cat.length)]);
1715
}

src/commands/dcma.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export const info = {
1111
};
1212

1313
export default async function (msg: Message): Promise<void> {
14-
if (!/^dcma$/i.test(msg.body)) return;
15-
1614
const text = `
1715
\`DCMA\`
1816

src/commands/delete.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export const info = {
1111
};
1212

1313
export default async function (msg: Message): Promise<void> {
14-
if (!/^delete/i.test(msg.body)) return;
15-
1614
if (!msg.hasQuotedMsg) {
1715
await msg.reply("Please reply the message you want to delete.");
1816
return;

src/commands/dyk.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export const info = {
1111
};
1212

1313
export default async function (msg: Message): Promise<void> {
14-
if (!/^dyk$/i.test(msg.body)) return;
15-
1614
const response = dyk[Math.floor(Math.random() * dyk.length)];
1715
await msg.reply(response);
1816
}

src/commands/env.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ export const info = {
1313
};
1414

1515
export default async function (msg: Message): Promise<void> {
16-
if (!/^env/i.test(msg.body)) return;
17-
1816
dotenv.config({ override: true });
19-
2017
await msg.reply("Dotenv override successfully.");
2118
}

src/commands/event.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ export const info = {
1010
};
1111

1212
export default async function (msg: Message): Promise<void> {
13-
if (!/^event/i.test(msg.body)) return;
14-
1513
let event: Message = msg;
16-
1714
if (msg.hasQuotedMsg) event = await msg.getQuotedMessage();
18-
1915
await msg.reply("```" + JSON.stringify(event, null, 2) + "```");
2016
}

src/commands/fork.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export const info = {
1010
};
1111

1212
export default async function (msg: Message): Promise<void> {
13-
if (!/^fork$/i.test(msg.body)) return;
14-
1513
const text = `
1614
\`Open Source\`
1715
Don't forget to leave a star and fork it on Github.

src/commands/joke.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export const info = {
1111
};
1212

1313
export default async function (msg: Message): Promise<void> {
14-
if (!/^joke$/i.test(msg.body)) return;
15-
1614
const response = joke[Math.floor(Math.random() * joke.length)];
1715
await msg.reply(response);
1816
}

src/commands/legal.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export const info = {
1111
};
1212

1313
export default async function (msg: Message): Promise<void> {
14-
if (!/^legal$/i.test(msg.body)) return;
15-
1614
const text = `
1715
\`Legal Commands\`
1816

0 commit comments

Comments
 (0)