-
-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cffa589
commit 4eaccbf
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const Command = require("../../base/Command.js"); | ||
|
||
class AutoPlay extends Command { | ||
|
||
constructor (client) { | ||
super(client, { | ||
name: "autoplay", | ||
dirname: __dirname, | ||
enabled: true, | ||
guildOnly: true, | ||
aliases: [], | ||
memberPermissions: [], | ||
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], | ||
nsfw: false, | ||
ownerOnly: false, | ||
cooldown: 5000 | ||
}); | ||
} | ||
|
||
async run (message) { | ||
|
||
const queue = this.client.player.getQueue(message); | ||
|
||
const voice = message.member.voice.channel; | ||
if (!voice){ | ||
return message.error("music/play:NO_VOICE_CHANNEL"); | ||
} | ||
|
||
if(!queue){ | ||
return message.error("music:play:NOT_PLAYING"); | ||
} | ||
|
||
// Gets the current song | ||
await this.client.player.setAutoPlay(message, !queue.autoPlay); | ||
|
||
// Send the embed in the current channel | ||
message.sendT(`music/autoplay:SUCCESS_${queue.autoPlay ? "ENABLED" : "DISABLED"}`); | ||
|
||
} | ||
|
||
} | ||
|
||
module.exports = AutoPlay; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"DESCRIPTION": "Enable or disable the autoplay feature", | ||
"USAGE": "{{prefix}}autoplay", | ||
"EXAMPLES": "{{prefix}}autoplay", | ||
"SUCCESS_ENABLED": "{{success}} Auto play is now enabled!", | ||
"SUCCESS_DISABLED": "{{success}} Auto play is now disabled!" | ||
} |