Fixed some commands not running
This commit is contained in:
parent
4caec5aefa
commit
7f5c6ab8f9
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ const client = require("../utils/client.js");
|
||||||
const database = require("../utils/database.js");
|
const database = require("../utils/database.js");
|
||||||
const logger = require("../utils/logger.js");
|
const logger = require("../utils/logger.js");
|
||||||
const collections = require("../utils/collections.js");
|
const collections = require("../utils/collections.js");
|
||||||
|
const commands = [...collections.aliases.keys(), ...collections.commands.keys()];
|
||||||
|
|
||||||
// run when someone sends a message
|
// run when someone sends a message
|
||||||
module.exports = async (message) => {
|
module.exports = async (message) => {
|
||||||
|
@ -14,7 +15,7 @@ module.exports = async (message) => {
|
||||||
|
|
||||||
// this is here to prevent reading the database if a message is unrelated
|
// this is here to prevent reading the database if a message is unrelated
|
||||||
let valid = false;
|
let valid = false;
|
||||||
for (const key of collections.aliases.keys()) {
|
for (const key of commands) {
|
||||||
const commandRegex = new RegExp(key, "i");
|
const commandRegex = new RegExp(key, "i");
|
||||||
if (commandRegex.test(message.content)) {
|
if (commandRegex.test(message.content)) {
|
||||||
valid = true;
|
valid = true;
|
||||||
|
|
Loading…
Reference in a new issue