mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-16 18:56:00 +00:00
More powerful number handling. Setting whether to announce songs starting to play. Remove command fixes
This commit is contained in:
@ -29,7 +29,7 @@ module.exports = async function (video, message, voiceChannel, client, playlist
|
||||
try {
|
||||
var connection = await voiceChannel.join();
|
||||
construct.connection = connection;
|
||||
client.funcs.play(message.guild, construct.songs[0], client, message, 0);
|
||||
client.funcs.play(message.guild, construct.songs[0], client, message, 0, true);
|
||||
} catch (error) {
|
||||
client.queue.delete(message.guild.id);
|
||||
client.channels.get('634718645188034560').send("Error with connecting to voice channel: " + error);
|
||||
|
@ -1,4 +1,4 @@
|
||||
module.exports = async function (guild, song, client, message, seek) {
|
||||
module.exports = async function (guild, song, client, message, seek, play) {
|
||||
const Discord = require('discord.js');
|
||||
const ytdl = require('ytdl-core');
|
||||
const serverQueue = client.queue.get(guild.id);
|
||||
@ -25,11 +25,13 @@ module.exports = async function (guild, song, client, message, seek) {
|
||||
});
|
||||
dispatcher.setVolume(serverQueue.volume / 10);
|
||||
dispatcher.on("error", error => console.error(error));
|
||||
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
|
||||
let songtime = (data.length_seconds * 1000).toFixed(0);
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(`:musical_note: Start playing: **${song.title}**`)
|
||||
.setDescription(`Song duration: \`${client.funcs.msToTime(songtime)}\``)
|
||||
.setColor("#b50002")
|
||||
serverQueue.textChannel.send(embed);
|
||||
if (client.global.db.guilds[guild.id].startPlaying || play) {
|
||||
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
|
||||
let songtime = (data.length_seconds * 1000).toFixed(0);
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(`:musical_note: Start playing: **${song.title}**`)
|
||||
.setDescription(`Song duration: \`${client.funcs.msToTime(songtime)}\``)
|
||||
.setColor("#b50002")
|
||||
serverQueue.textChannel.send(embed);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user