Skip to content

Commit

Permalink
Fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodOne120 committed Jul 4, 2024
1 parent 5f7d332 commit 7f6b85b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 22 deletions.
12 changes: 6 additions & 6 deletions actions/control_music_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ module.exports = {
}

if (!Bot.bot.queue) return this.callNextAction(cache);

const queue = Bot.bot.queue.get(server.id);
if(!queue) return this.callNextAction(cache);
if (!queue) return this.callNextAction(cache);

try {
switch (action) {
case 0:
queue.connection.disconnect();
queue.connection.disconnect();
break;
case 1:
queue.player.pause();
Expand All @@ -118,11 +118,11 @@ module.exports = {
queue.player.unpause();
break;
case 3:
queue.player.stop()
queue.player.stop();
break;
case 4:
queue.currentIndex -= 2;
queue.player.stop()
queue.player.stop();
break;
case 5:
queue.songs = [];
Expand All @@ -149,4 +149,4 @@ module.exports = {
},

mod() {},
};
};
13 changes: 9 additions & 4 deletions actions/play_music_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ module.exports = {
const Mods = this.getMods();
const ytdl = Mods.require('@distube/ytdl-core');
const ytpl = Mods.require('@distube/ytpl');
const { joinVoiceChannel, createAudioPlayer, createAudioResource, AudioPlayerStatus, VoiceConnectionStatus } = require('@discordjs/voice');
const {
joinVoiceChannel,
createAudioPlayer,
createAudioResource,
AudioPlayerStatus,
VoiceConnectionStatus,
} = require('@discordjs/voice');
const voiceChannel = await this.getVoiceChannelFromData(data.voiceChannel, data.varName, cache);

if (!Bot.bot.queue) Bot.bot.queue = new Map();
Expand Down Expand Up @@ -105,12 +111,12 @@ module.exports = {
return this.callNextAction(cache);
}

songs = playlist.items.map(item => ({
songs = playlist.items.map((item) => ({
title: item.title,
thumbnail: item.thumbnail,
url: item.shortUrl,
author: item.author.name,
duration: item.duration.split(':').reduce((acc, time) => (60 * acc) + +time),
duration: item.duration.split(':').reduce((acc, time) => 60 * acc + +time),
requestedBy: cache.getUser().id,
}));
} else {
Expand Down Expand Up @@ -234,7 +240,6 @@ module.exports = {
queueData.player.removeAllListeners();
Bot.bot.queue.delete(server.id);
});

} else {
if (data.type === '1') {
const currentSong = serverQueue.songs[serverQueue.currentIndex];
Expand Down
6 changes: 3 additions & 3 deletions actions/remove_from_queue_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ module.exports = {
const amount = parseInt(this.evalMessage(data.amount, cache), 10);

if (!Bot.bot.queue) return this.callNextAction(cache);

const queue = Bot.bot.queue.get(targetServer.id);
if(!queue) return this.callNextAction(cache);
if (!queue) return this.callNextAction(cache);

if (queue.songs && queue.songs.length > position && amount > 0) {
queue.songs.splice(position, amount);
}
Expand Down
22 changes: 14 additions & 8 deletions actions/store_queue_info_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,22 @@ module.exports = {
</p>
</div>
`;
},
},

init() {
const { document } = this;
document.toggleRepeatText = function() {

document.toggleRepeatText = function () {
const infoSelect = document.getElementById('info');
const repeatModeText = document.getElementById('repeatModeText');

if (infoSelect.value === '3') {
repeatModeText.style.display = 'block';
} else {
repeatModeText.style.display = 'none';
}
};

document.toggleRepeatText();
},

Expand All @@ -118,7 +118,7 @@ module.exports = {
if (!Bot.bot.queue) return this.callNextAction(cache);

queue = Bot.bot.queue.get(server);
if(!queue) return this.callNextAction(cache);
if (!queue) return this.callNextAction(cache);
}

let result;
Expand Down Expand Up @@ -146,12 +146,18 @@ module.exports = {
const currentHours = Math.floor(currentTime / 3600);
const currentMinutes = Math.floor((currentTime % 3600) / 60);
const currentSeconds = Math.floor(currentTime % 60);

const totalHours = Math.floor(totalTime / 3600);
const totalMinutes = Math.floor((totalTime % 3600) / 60);
const totalSeconds = Math.floor(totalTime % 60);

result = `${currentHours > 0 ? `${currentHours}:` : ''}${currentHours > 0 && currentMinutes < 10 ? '0' : ''}${currentMinutes}:${currentSeconds < 10 ? '0' : ''}${currentSeconds}${progressBar}${totalHours > 0 ? `${totalHours}:` : ''}${totalHours > 0 && totalMinutes < 10 ? '0' : ''}${totalMinutes}:${totalSeconds < 10 ? '0' : ''}${totalSeconds}`;
result = `${currentHours > 0 ? `${currentHours}:` : ''}${
currentHours > 0 && currentMinutes < 10 ? '0' : ''
}${currentMinutes}:${currentSeconds < 10 ? '0' : ''}${currentSeconds}${progressBar}${
totalHours > 0 ? `${totalHours}:` : ''
}${totalHours > 0 && totalMinutes < 10 ? '0' : ''}${totalMinutes}:${
totalSeconds < 10 ? '0' : ''
}${totalSeconds}`;
break;
case 5:
result = queue.songs.map((song, index) => `${index + 1}. ${song.title} - ${song.author}`).join('\n');
Expand Down
9 changes: 8 additions & 1 deletion actions/store_track_info_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ module.exports = {
fields: ['trackObject', 'varName', 'info', 'storage', 'varName1'],

subtitle({ info }) {
const names = ['Track Title', 'Track Thumbnail', 'Track URL', 'Track Author', 'Track Duration (In seconds)', 'Requested By (User ID)'];
const names = [
'Track Title',
'Track Thumbnail',
'Track URL',
'Track Author',
'Track Duration (In seconds)',
'Requested By (User ID)',
];
return `${names[parseInt(info, 10)]}`;
},

Expand Down

0 comments on commit 7f6b85b

Please sign in to comment.