Skip to content

Commit

Permalink
[Fix] skip now disables the repeat mode if it was activated!
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Nov 16, 2021
1 parent 45df016 commit e8bd829
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions commands/Music/skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ module.exports = {
});

try {
if (queue.repeatMode !== 0) queue.setRepeatMode(0);
const currnetSong = queue.current;

await queue.skip();
return await message.channel.send({
embeds: [
Expand Down
12 changes: 8 additions & 4 deletions modules/commandsHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ let commandsHelper = function () {
* @param {string} commandsFolder Path to folder that contains all commands
* @returns array of commands
*/
api.getAllCommands = function (commandsFolder) {

api.getAllCommands = (commandsFolder) => {
var result = [];
const allCommandsFolders = fs.readdirSync(commandsFolder);

Expand All @@ -38,7 +39,8 @@ let commandsHelper = function () {
* @param {string} commandsFolder Path to folder that contains all commands
* @param {Client} client The discord client
*/
api.registerAllCommands = function (commandsFolder, client) {

api.registerAllCommands = (commandsFolder, client) => {
let commands = api.getAllCommands(commandsFolder);
client.logger(`Found ${commands.length} Commands, Loading...`);

Expand All @@ -54,7 +56,8 @@ let commandsHelper = function () {
* @param {string} commandsFolder Path to folder that contains all commands
* @returns an array of json definitions
*/
api.getAllCommandsAsJson = function (commandsFolder) {

api.getAllCommandsAsJson = (commandsFolder) => {
let commands = api.getAllCommands(commandsFolder);

let result = [];
Expand All @@ -71,7 +74,8 @@ let commandsHelper = function () {
* @param {string} eventFolder Path to folder that contains all events
* @param {Client} client The discord client
*/
api.registerAllEvents = function (eventFolder, client) {

api.registerAllEvents = (eventFolder, client) => {
const eventFiles = fs
.readdirSync(eventFolder)
.filter((file) => file.endsWith(".js"));
Expand Down

0 comments on commit e8bd829

Please sign in to comment.