Comments (11)
Hello @BrianWasTkn!
Thank you for your suggestions/issue, let me tell you more about it!
Suggestions
Filters
Do you mean YouTube filters? Please let me know, I am already working on it.
Shuffle
There is a way by using JS to shuffle the queue, but I can make it easier - I am going to work on it.
Volume
Do you mean Volume? It's already a function in the module.
Issues
Now Playing Issue
Can you provide more information about it? Is that happening when the music is not playing?
Also, can you check this issue?
Let me know about it.
from discord-music-player.
Hey, thank you for the code.
I did not found any code issues, could you please tell me what is [code] returning?
client.player.nowPlaying(guildID);
That would help me with resolving the issue.
Thanks.
from discord-music-player.
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!
from discord-music-player.
Hey! Can I see your index
, play
and message
code? That would help me with resolving the issue.
from discord-music-player.
Um, My main index file is in a class
to load other stuff but, I can show you the part where I initialized it.
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}`)
}
*/
})
from discord-music-player.
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
from discord-music-player.
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
}
from discord-music-player.
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.`);
}
from discord-music-player.
Hey, the shuffle feature is under development and would be there in few days (with v6.0.0 update)!
from discord-music-player.
We started working on it per #13.
from discord-music-player.
This issue (and suggestions) are resolved (implemented) in v6.0.0 Update.
Thank you for reporting the issues and the suggestions!
from discord-music-player.
Related Issues (20)
- [BUG] queue.playlist() throwing errors
- [BUG] ytdl-core throws "aborted" error on longer songs HOT 1
- [FR] custom ffmpeg filters for stuff like bassboost
- [BUG] Throwing undefined in Queue#connection. HOT 2
- [FR] Fetch All Tracks from Spotify Playlist HOT 1
- [BUG] DMPError VoiceConnection Error in Linux
- [BUG] Unhandled error when trying to play music HOT 1
- [BUG] Queue.move is not a function HOT 8
- [BUG] play mp3 audio from url
- [BUG] Error in display_name property when loading a playlist HOT 3
- [BUG] ab_channel query is broke the queue.play HOT 3
- Playlist.setData
- [BUG] Error: Invalid header check HOT 1
- [BUG] Bot exits after playing ~30sec of music. HOT 9
- [BUG] DMP error: missing catch or finally
- TypeError: client.player.getQueue is not a function
- [BUG] Multiple Attempts to resolve one video HOT 6
- [BUG] SearchIsNull: The was no YouTube song found by that query. HOT 5
- [BUG] Playing a SPECIFIC YouTube video link doesn't play the exact same video
- [BUG] Short bug description
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-music-player.