-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion #3
Comments
Hello @BrianWasTkn! SuggestionsFiltersDo you mean YouTube filters? Please let me know, I am already working on it. ShuffleThere is a way by using JS to shuffle the queue, but I can make it easier - I am going to work on it. VolumeDo you mean Volume? It's already a function in the module. IssuesNow Playing IssueCan you provide more information about it? Is that happening when the music is not playing? Let me know about it. |
Hey! I wanna thank you for viewing my issue :) Yes, Some filters and enhancements like bassboost, 8d and etc... And about the nowplaying issue, i tried and debugged what the .nowPlaying method returns and it was empty or null. Liie, it doesn't return the current song playing in the queue. Ty! |
Hey! Can I see your |
Um, My main index file is in a index import { Player } from 'discord-music-player'
import { Client } from 'discord.js'
// ...
class extends Client {
constructor(clientOptions, playerOptions) {
this.player = new Player(this, playerOptions)
}
} play import Command from '../modules/command.js';
export default new Command({
name: 'play',
description: 'Play a song through searching, or even YouTube and Soundcloud',
aliases: ['p'],
permissions: ['SEND_MESSAGES'],
usage: '<query>',
cooldown: 3e3
}, async (bot, message, args) => {
// State of the current member in/out of a VC
const voiceChannel = message.member.voice.channel;
// Member is not in a voice channel
if (!voiceChannel) return 'You\'re not in a voice channel, pleace join in one.'
// Args is empty so no song to play
if (!args) return 'You need something to play'
// Check if a track is currently playing
const onQueue = bot.player.isPlaying(message.guild.id);
if (onQueue) {
try {
const track = await bot.player.addToQueue(message.guild.id, args.join(' '), message.author.tag);
const thumbRegex = /^(https\:\/\/i\.ytimg\.com\/vi.*\/.*\.(jpg|png|gif|webp))/gi;
track.song.thumbnail = thumbRegex.exec(track.song.thumbnail)[1];
// Return a message
await message.channel.send({
embed: {
title: 'Added to Queue',
color: 'BLUE',
thumbnail: track.song.thumbnail,
fields: [
{
name: `**__Requested by ${track.song.requestedBy}__**`,
value: `**Song:** [${track.song.name}](${track.song.url})\n**Duration:** ${track.song.duration}\n**Author:** ${track.song.author.name}`
}
]
}
});
} catch(error) {
bot.logger.command(`I cannot play the track: ${error.message}`)
}
} else {
try {
const track = await bot.player.play(voiceChannel, args.join(' '), message.author.tag);
const thumbRegex = /^(https\:\/\/i\.ytimg\.com\/vi.*\/.*\.(jpg|png|gif|webp))/gi;
track.song.thumbnail = thumbRegex.exec(track.song.thumbnail)[1];
// Return a message
await message.channel.send({
embed: {
title: 'Now Playing',
color: 'BLUE',
thumbnail: track.song.thumbnail,
fields: [
{
name: `**__Requested by ${track.song.requestedBy}__**`,
value: `**Song:** [${track.song.name}](${track.song.url})\n**Duration:** ${track.song.duration}\n**Author:** ${track.song.author.name}`
}
]
}
});
// Player events (temporary)
const queue = bot.player.getQueue(message.guild.id);
// song X is finished
queue.on('songChanged', async (oldTrack, newTrack) => {
await message.channel.send(`Now playing **${newTrack.name}** on the queue...`);
});
// queue ended
queue.on('end', async() => {
await message.channel.send('No song left to play, leaving channel...')
await voiceChannel.leave()
});
} catch(error) {
bot.logger.command(`I cannot play the track: ${error.message}`)
}
}
/**
// try and play it
try {
// play the song
await bot.player.play(message, args.join(' '));
} catch(error) {
bot.logger.command(`I cannot play the track: ${error.message}`)
}
*/
}) |
Hey, thank you for the code. client.player.nowPlaying(guildID); That would help me with resolving the issue. Thanks. |
Hey! I'm sorry for the delay, the project has errors due to something but in about one hour I'll try and debug it :D |
Alright, here's the output now: Song {
name: 'Luis Fonsi - Despacito ft. Daddy Yankee',
duration: '4:42',
author: [Object],
url: 'https://www.youtube.com/watch?v=kJQP7kiw5Fk',
thumbnail: 'https://i.ytimg.com/vi/kJQP7kiw5Fk/hq720.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBH3EhyCr_aZDODXzXVDL-taforQw',
queue: [Queue],
requestedBy: undefined
} |
Can you try checking if the queue is not null (the song is not null) and we are going to investigate this issue? Just try checking a Song via client.player.nowPlaying(guildID)
.catch(err) {
// Message is not playing.
return message.reply(`No song set.`);
} |
Hey, the shuffle feature is under development and would be there in few days (with v6.0.0 update)! |
We started working on it per #13. |
This issue (and suggestions) are resolved (implemented) in v6.0.0 Update. Thank you for reporting the issues and the suggestions! |
Hello, I wanna suggest or request some new features for this package. These features are broken on the original package (discord-player) so I wanna suggest it here.
Some issues:
The only issue I found is the
client.player.nowPlaying(message.guild.id)
method as it returnsnull
orundefined
.Thanks!
The text was updated successfully, but these errors were encountered: