move filter up
This commit is contained in:
parent
aca38d2924
commit
fc5f7fdc82
1 changed files with 8 additions and 7 deletions
15
src/index.ts
15
src/index.ts
|
@ -11,8 +11,6 @@ import { commands } from './commands';
|
|||
import { filterMessage } from './filters';
|
||||
import { parseLog } from './logs';
|
||||
|
||||
import { green, bold, blue, underline, yellow } from 'kleur/colors';
|
||||
|
||||
import {
|
||||
parse as discordParse,
|
||||
type SuccessfulParsedMessage,
|
||||
|
@ -21,7 +19,9 @@ import {
|
|||
import { readFile } from 'fs/promises';
|
||||
import { join } from 'path';
|
||||
|
||||
import { green, bold, blue, underline, yellow } from 'kleur/colors';
|
||||
import 'dotenv/config';
|
||||
|
||||
export interface Command {
|
||||
name: string;
|
||||
aliases?: string[];
|
||||
|
@ -93,6 +93,11 @@ client.once('ready', async () => {
|
|||
return;
|
||||
}
|
||||
|
||||
const messageIsOK = await filterMessage(e);
|
||||
if (!messageIsOK) {
|
||||
return;
|
||||
}
|
||||
|
||||
const commanded = await parseMsg(e);
|
||||
if (commanded) return;
|
||||
|
||||
|
@ -101,11 +106,6 @@ client.once('ready', async () => {
|
|||
e.reply({ embeds: [log] });
|
||||
return;
|
||||
}
|
||||
|
||||
const filtered = await filterMessage(e);
|
||||
if (!filtered) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -138,6 +138,7 @@ async function parseMsg(e: Message) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
await cmd.exec(e, parsed);
|
||||
} catch (err: unknown) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue