trying to handle music

This commit is contained in:
DeSqBlocki
2024-08-02 13:25:06 +02:00
parent a74e19be5a
commit 2925fb59dd
42 changed files with 3708 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
const { Events } = require('discord.js')
require('dotenv').config()
const { client } = require('../index')
const prefix = process.env.D_Prefix
module.exports = {
name: Events.MessageCreate,
once: false,
async execute(message) {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
const cmd = args.shift().toLowerCase();
let command = client.legacyCommands.get(cmd)
if(!command) command = client.legacyCommands.get(client.aliases.get(cmd))
if(!command) return
try {
client.legacyCommands.get(command.name).execute(message, args)
} catch (error) {
console.error(error)
}
}
}