RavenBot/events/message.js
2021-04-23 14:20:48 -05:00

16 lines
568 B
JavaScript

const Discord = require("discord.js");
require('dotenv').config()
const functions = require("../functions/functions.js");
module.exports = async (bot, message) => {
let prefix = process.env.PREFIX;
const args = message.content.split(/ +/g);
const command = args.shift().slice(prefix.length).toLowerCase();
const cmd = bot.commands.get(command) || bot.aliases.get(command);
if(!message.content.toLowerCase().startsWith(prefix) || !message.guild || message.author.bot || !cmd) return;
cmd.run(bot, message, args, functions)
}