mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 03:33:17 +00:00
Merge branch 'master' of https://github.com/MatteZ02/Musix-V2
This commit is contained in:
commit
03ec1ddf64
@ -17,6 +17,7 @@ module.exports = {
|
|||||||
if (client.global.db.guilds[message.guild.id].premium) {
|
if (client.global.db.guilds[message.guild.id].premium) {
|
||||||
if (args[1] === 'play') {
|
if (args[1] === 'play') {
|
||||||
const voiceChannel = message.member.voiceChannel;
|
const voiceChannel = message.member.voiceChannel;
|
||||||
|
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to play music!');
|
||||||
const permissions = voiceChannel.permissionsFor(message.client.user);
|
const permissions = voiceChannel.permissionsFor(message.client.user);
|
||||||
if (!permissions.has('CONNECT')) {
|
if (!permissions.has('CONNECT')) {
|
||||||
return message.channel.send(':x: I cannot connect to your voice channel, make sure I have the proper permissions!');
|
return message.channel.send(':x: I cannot connect to your voice channel, make sure I have the proper permissions!');
|
||||||
|
@ -7,7 +7,7 @@ module.exports = async function (guild, song, client, message, seek) {
|
|||||||
client.queue.delete(guild.id);
|
client.queue.delete(guild.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const dispatcher = serverQueue.connection
|
const dispatcher = message.guild.voiceConnection.playStream
|
||||||
.playStream(ytdl(song.url, { filter: "audio", highWaterMark: 1 << 25 }), { seek: seek, bitrate: 1024, passes: 10, volume: 1 })
|
.playStream(ytdl(song.url, { filter: "audio", highWaterMark: 1 << 25 }), { seek: seek, bitrate: 1024, passes: 10, volume: 1 })
|
||||||
.on("end", reason => {
|
.on("end", reason => {
|
||||||
if (reason === "Stream is not generating quickly enough.") {
|
if (reason === "Stream is not generating quickly enough.") {
|
||||||
|
Loading…
Reference in New Issue
Block a user