Music Player
// Imports
const { Client, commandHandler, playerHandler } = require("djsplus")
// Client
let client = new Client()
// Config
client.config.prefix = "?" // Command Prefix
// Command Handler
commandHandler(client, __dirname)
// Music Player
playerHandler(client)
// Login
client.login("Your bot token")module.exports = {
name: "play", // Command Name
module: "music", // Must be a valid key to a module.
execute: (client, message, args) => {
if(!args[0]) {
message.channel.send("Please specify a song to play")
return
}
client.player.play(message, args[0])
// By default, the message "Now playing (TRAC TITLE)"
// is shown, so no confirmation message needed.
}
}Last updated