Coder Social home page Coder Social logo

eritislami / evobot Goto Github PK

View Code? Open in Web Editor NEW
1.8K 1.8K 2.0K 1.31 MB

๐Ÿค– EvoBot is a Discord Music Bot built with TypeScript + Discord.js, includes Docker builds & localization in 20+ languages

License: MIT License

Dockerfile 1.39% TypeScript 98.61%
command-handler discord discord-bot discord-js discord-music-bot discordjs docker typescript

evobot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evobot's Issues

Limit playlist sizes

Is it possible to limit playlist sizes. The bot has been great but a user on one channel keeps adding a playlist of over 100 songs at a time. Could this be limited to say 5 or 10?

SyntaxError: Unexpected token.

SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/root/bots/evobot/node_modules/discord.js/src/index.js:8:11)

This got to be a joke. If i delete your package.json and replace it with my own i get another garbage error: (node:26823) UnhandledPromiseRejectionWarning: TypeError: Cannot destructure property channel of 'undefined' or 'nu ll'.
at Object.execute (/root/bots/evobot/commands/play.js:11:40)
at Client.client.on (/root/bots/evobot/index.js:48:36)

Bot error on manual disconnection by user

Describe the bug
If you disconnect the bot manually, it stops working properly.

How To Reproduce
Steps to reproduce the behavior:
1.Play a song
2.Manually disconnect the bot

Expected behavior
The bot should stop/clear the queue if it get's manually disconnected by a user.

Environment (add if possible)

  • Node.js version: 12.x^

The Bot is not playing any song

errors: [ { domain: 'usageLimits', reason: 'accessNotConfigured', message: 'Project 1048051177020 has been scheduled for deletion and cannot be used for API calls. Visit https://console.developers.google.com/iam-admin/projects?pendingDeletion=true to undelete the project.', extendedHelp: 'https://console.developers.google.com/iam-admin/projects?pendingDeletion=true' } ], code: 403, message: 'Project 1048051177020 has been scheduled for deletion and cannot be used for API calls. Visit https://console.developers.google.com/iam-admin/projects?pendingDeletion=true to undelete the project.' } { errors: [ { domain: 'usageLimits', reason: 'accessNotConfigured', message: 'Project 1048051177020 has been scheduled for deletion and cannot be used for API calls. Visit https://console.developers.google.com/iam-admin/projects?pendingDeletion=true to undelete the project.', extendedHelp: 'https://console.developers.google.com/iam-admin/projects?pendingDeletion=true' } ], code: 403, message: 'Project 1048051177020 has been scheduled for deletion and cannot be used for API calls. Visit https://console.developers.google.com/iam-admin/projects?pendingDeletion=true to undelete the project.' }

This is the error, I found in the console.

Check if queue exists before checking user channel

Describe the bug
On using playlist commands, bot responds with "you need to join voice channel first" in dm.

How To Reproduce
Steps to reproduce the behavior:
1.Join a voice channel
2.Use skip command

Expected behavior
Bot should respond with "Nothing is playing" in server text channel instead of dm....

Environment (add if possible)

  • Node.js version: ^12.0.x

Info
This should be an issue in canModifyQueue()

In canModifyQueue() you only check for the channel but not for the queue playing...
There should be different messages for both things...

bot is not starting how to fix it

internal/modules/cjs/loader.js:985
throw err;
^

Error: Cannot find module 'node-fetch'
Require stack:

  • e:\discord bot\evobot-master\node_modules\discord.js\src\util\Util.js
  • e:\discord bot\evobot-master\node_modules\discord.js\src\index.js
  • e:\discord bot\evobot-master\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object. (e:\discord bot\evobot-master\node_modules\discord.js\src\util\Util.js:4:15)
    at

No Volume Limits

This bot is fantastic and i really appreciate the work you've done.

After playing around with the bot i noticed the !volume command can be abused and set to anything.

e.g. !volume 100000000 or even !volume randomtext

Would be great if it would limit the bot to just numbers between 1-100

Thank you!

Add lavalink support.

As ffmepg gives studdering noise on Discord if you don't have a stable network. And lavalink is now very popular on Discord. It's be great if all the music bots on Discord have High Quality Music Streaming.

For Glitch Users:Patch

When using glitch, it used nodejs v10 by default, so some commands do not work as how they are expected. In order to fix, modify the package.json file and add in the code:

"engines": { "node": "12.x" },

Hope this can fix glitch users :)

Bot gets stuck if i play region blocked song...

Describe the bug
Whenever i try to play a song that is blocked in my region the bot gives this error and does not respond to any more commands...

(node:11484) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'url' of undefined
    at D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\ytdl-core-discord\index.js:40:41
    at D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\ytdl-core-discord\node_modules\ytdl-core\lib\info.js:289:23
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:11484) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11484) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior
The error should be properly handeled...

Media Controls via Reactions Disappear

When your playing a song and you go to pause it after 5 minutes the Media Controls via Reactions get removed. Meaning you have to manually type /resume or /skip.

I've also noticed once the song has been resumed it will play for around 20 seconds and then go silent. It will resume after about 30 seconds and play the song for a few seconds and then skip to the next song. Once the next song plays on the queue it will only play for a short period of time and then the bot leaves.

๐Ÿ‘

Error on search command

I have this error
Screenshot_20200612_212833
This is the const channel code:
const channel = message.member.voice

I still have the same code of search.js in this repository

Bot playlist controls can be improved...

Is your feature request related to a problem? Please describe.
Anyone can stop the music instead of the voting system like other bots have. Ex. I'm always frustrated when someone skips the song without asking anyone in the voice channel...

Describe the solution you'd like
I would like a simillar voting system like other bots have (add react to vote feature if you want instead of commands)

Cannot find module

(node:1035) UnhandledPromiseRejectionWarning: Error: Error: Cannot find module '/home/evobot/node_modules/@discordjs/opus/prebuild/node-v72-napi-v3-linux-x64-glibc-2.24/opus.node'
Require stack:

  • /home/evobot/node_modules/@discordjs/opus/lib/index.js
  • /home/evobot/node_modules/prism-media/src/util/loader.js
  • /home/evobot/node_modules/prism-media/src/opus/Opus.js
  • /home/evobot/node_modules/prism-media/src/opus/index.js
  • /home/evobot/node_modules/prism-media/src/index.js
  • /home/evobot/node_modules/discord.js/src/client/voice/player/BasePlayer.js
  • /home/evobot/node_modules/discord.js/src/client/voice/player/BroadcastAudioPlayer.js
  • /home/evobot/node_modules/discord.js/src/client/voice/VoiceBroadcast.js
  • /home/evobot/node_modules/discord.js/src/client/voice/ClientVoiceManager.js
  • /home/evobot/node_modules/discord.js/src/client/Client.js
  • /home/evobot/node_modules/discord.js/src/index.js
  • /home/evobot/index.js
    Error: Cannot find module 'node-opus'
    Require stack:
  • /home/evobot/node_modules/prism-media/src/util/loader.js
  • /home/evobot/node_modules/prism-media/src/opus/Opus.js
  • /home/evobot/node_modules/prism-media/src/opus/index.js
  • /home/evobot/node_modules/prism-media/src/index.js
  • /home/evobot/node_modules/discord.js/src/client/voice/player/BasePlayer.js
  • /home/evobot/node_modules/discord.js/src/client/voice/player/BroadcastAudioPlayer.js
  • /home/evobot/node_modules/discord.js/src/client/voice/VoiceBroadcast.js
  • /home/evobot/node_modules/discord.js/src/client/voice/ClientVoiceManager.js
  • /home/evobot/node_modules/discord.js/src/client/Client.js
  • /home/evobot/node_modules/discord.js/src/index.js
  • /home/evobot/index.js
    Error: Cannot find module 'opusscript'
    Require stack:
  • /home/evobot/node_modules/prism-media/src/util/loader.js
  • /home/evobot/node_modules/prism-media/src/opus/Opus.js
  • /home/evobot/node_modules/prism-media/src/opus/index.js
  • /home/evobot/node_modules/prism-media/src/index.js
  • /home/evobot/node_modules/discord.js/src/client/voice/player/BasePlayer.js
  • /home/evobot/node_modules/discord.js/src/client/voice/player/BroadcastAudioPlayer.js
  • /home/evobot/node_modules/discord.js/src/client/voice/VoiceBroadcast.js
  • /home/evobot/node_modules/discord.js/src/client/voice/ClientVoiceManager.js
  • /home/evobot/node_modules/discord.js/src/client/Client.js
  • /home/evobot/node_modules/discord.js/src/index.js
  • /home/evobot/index.js
    at Object.loader [as require] (/home/evobot/node_modules/prism-media/src/util/loader.js:12:9)
    at loadOpus (/home/evobot/node_modules/prism-media/src/opus/Opus.js:17:17)
    at new OpusStream (/home/evobot/node_modules/prism-media/src/opus/Opus.js:46:10)
    at new Decoder (/home/evobot/node_modules/prism-media/src/opus/Opus.js:169:1)
    at AudioPlayer.playOpusStream (/home/evobot/node_modules/discord.js/src/client/voice/player/BasePlayer.js:73:23)
    at VoiceConnection.play (/home/evobot/node_modules/discord.js/src/client/voice/util/PlayInterface.js:75:28)
    at play (/home/evobot/include/play.js:31:8)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    (node:1035) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:1035) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is it possible to automatically set the bot volume according to the music...

Is it possible to automatically set the bot volume according to the music (like spotify does), so that if the music volume is too loud the bot can automatically set it to a lower volume, so that peoples' ears dont blow up when you start the queue... Ofc, this is not that required but it can be a good feature to add to the bot.

Started Playing - embed enhancement..

I think this embed looks much better than posting the song link when playing the song...

include/play.js changes-

try {
      let startedPlayingEmbed = new MessageEmbed()
      .setTitle("๐ŸŽถ Started playing!")
      .setDescription(`**${song.title}**`)
      .setURL(`${song.url}`)
      .setColor(`${UI_COLOUR}`)
      .setImage(song.thumbnail);
      var playingMessage = await queue.textChannel.send(startedPlayingEmbed);
      await playingMessage.react("โญ");
      await playingMessage.react("โธ");
      await playingMessage.react("โ–ถ");
      await playingMessage.react("๐Ÿ”");
      await playingMessage.react("โน");
    } catch (error) {
      console.error(error);
    }

commands/play.js changes-

if (urlValid) {
      try {
        songInfo = await ytdl.getInfo(url);
        song = {
          title: songInfo.videoDetails.title,
          url: songInfo.videoDetails.video_url,
          duration: songInfo.videoDetails.length_seconds,
          thumbnail: songInfo.videoDetails.thumbnail.thumbnails[3].url
        };
      } catch (error) {
        if (error.message.includes("copyright")) {
          return message
            .reply("โ›” The video could not be played due to copyright protection โ›”")
            .catch(console.error);
        } else {
          console.error(error);
          return message.reply(error.message).catch(console.error);
        }
      }
    } else {
      try {
        const results = await youtube.searchVideos(search, 1);
        songInfo = await ytdl.getInfo(results[0].url);
        song = {
          title: songInfo.videoDetails.title,
          url: songInfo.videoDetails.video_url,
          duration: songInfo.videoDetails.length_seconds,
          thumbnail: songInfo.videoDetails.thumbnail.thumbnails[3].url
        };

commands/playlist.js changes-

videos.forEach((video) => {
      song = {
        title: video.title,
        url: video.url,
        duration: video.durationSeconds,
        thumbnail: video.thumbnails.medium.url
        };

image

Livestream Support

Hello,
I was trying to play a livestream and I got this error

(node:11344) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!
at Function.getInfo (C:\Users\alhas\Desktop\evobot-master\node_modules\prism-media\src\core\FFmpeg.js:130:11)
at Function.create (C:\Users\alhas\Desktop\evobot-master\node_modules\prism-media\src\core\FFmpeg.js:143:38)
at new FFmpeg (C:\Users\alhas\Desktop\evobot-master\node_modules\prism-media\src\core\FFmpeg.js:44:27)
at C:\Users\alhas\Desktop\evobot-master\node_modules\ytdl-core-discord\index.js:35:24
at C:\Users\alhas\Desktop\evobot-master\node_modules\ytdl-core-discord\node_modules\ytdl-core\lib\info.js:289:23
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:11344) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11344) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Bot stops working if too many people send messages at the same time

Describe the bug
Bot stops working if too many people send messages at the same time.

How To Reproduce
Steps to reproduce the behavior:
1.spam play command in chat 2-4 times.
2.after about 2-4 messages when you try to stop the song, it gives an error.

Expected behavior
I think the bot should wait for earlier commands to get executed completely, So after a command completely is executed then only it will respond to another message from the user.

Environment (add if possible)

  • Node.js version: 12.^

Additional information & screenshots
Error

TypeError: Cannot read property 'end' of null
    at ReactionCollector.<anonymous> (D:\Other\Bot Coding\Bots\evobot\include\play.js:119:41)
    at ReactionCollector.emit (events.js:327:22)
    at ReactionCollector.handleCollect (D:\Other\Bot Coding\Bots\evobot\node_modules\discord.js\src\structures\interfaces\Collector.js:100:12)
    at Client.emit (events.js:327:22)
    at MessageReactionAdd.handle (D:\Other\Bot Coding\Bots\evobot\node_modules\discord.js\src\client\actions\MessageReactionAdd.js:44:17)
    at Object.module.exports [as MESSAGE_REACTION_ADD] (D:\Other\Bot Coding\Bots\evobot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_REACTION_ADD.js:4:37)
    at WebSocketManager.handlePacket (D:\Other\Bot Coding\Bots\evobot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (D:\Other\Bot Coding\Bots\evobot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (D:\Other\Bot Coding\Bots\evobot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (D:\Other\Bot Coding\Bots\evobot\node_modules\ws\lib\event-target.js:125:16)
(node:13780) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
    at RequestHandler.execute (D:\Other\Bot Coding\Bots\evobot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:13780) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13780) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Duration & Author

How can i show who's the author of the music / song? And i also want to know how i can show the duratuon of the song / music ๐Ÿ˜€

Search & Select videos

Is your feature request related to a problem? Please describe.
Not really, but yknow, theres some music that has bass boosted version, reaction of the music video etc. Sometimes the bot plays the different music than what you want

Describe the solution you'd like
It would be cool if you will add a selection feature / embed. What this does is, when you type "!play NCS Warrior", there would be an embed that would show up and 5 different NCS Warrior music (This could be a bass boosted etc), then in that embed, there would be 5 reactions (from 1 to 5), and if you react with the number 2 (couรฑf be anything from 1-5) emoji, the bot will play the music that is in the 2nd choices

Hope you make this happen ๐Ÿ˜€

Live videos cannot be played by the bot

Whenever i try to play a live video it throws this error. And the bot doesn't respond to any commands after this error. Also stop doesn't work.

(node:13448) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!
    at Function.getInfo (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\prism-media\src\core\FFmpeg.js:130:11)
    at Function.create (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\prism-media\src\core\FFmpeg.js:143:38)
    at new FFmpeg (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\prism-media\src\core\FFmpeg.js:44:27)
    at D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\ytdl-core-discord\index.js:35:24
    at D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\ytdl-core-discord\node_modules\ytdl-core\lib\info.js:289:23
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:13448) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13448) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is the error after the stop command

(node:13448) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TypeError: Cannot read property 'end' of null
    at Object.execute (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\commands\stop.js:12:39)
    at Client.<anonymous> (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\index.js:48:36)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (D:\Other\Bot Coding\Bots\Ririchiyo Release 1.3\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)

Bot stops playing the song after some time and gives this error...

events.js:288
throw er; // Unhandled 'error' event
^

Error: Status code: 416
at ClientRequest. (D:\Bots\evobot-master\node_modules\miniget\dist\index.js:128:27)
at Object.onceWrapper (events.js:418:26)
at ClientRequest.emit (events.js:311:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:603:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at TLSSocket.socketOnData (_http_client.js:476:22)
at TLSSocket.emit (events.js:311:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at TLSSocket.Readable.push (_stream_readable.js:209:10)
Emitted 'error' event on PassThrough instance at:
at errorOrDestroy (internal/streams/destroy.js:108:12)
at PassThrough.onerror (_stream_readable.js:746:7)
at PassThrough.emit (events.js:311:20)
at PassThrough. (D:\Bots\evobot-master\node_modules\ytdl-core\lib\index.js:133:14)
at PassThrough.emit (events.js:323:22)
at ClientRequest. (D:\Bots\evobot-master\node_modules\miniget\dist\index.js:133:28)
at Object.onceWrapper (events.js:418:26)
[... lines matching original stack trace ...]
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)

The bot does not store the 'volume' value for a single guild.

The volume of the bot has to be changed everytime when playing another queue... This could be fixed by adding a new map for guild specific volume, also the volume changes are global and not guild specific... So if someone changes the volume on another server it changes that on all servers.

Disconnect Before Music Ends

When I Play Music Bot Disconnect Before Music Ends Saying Music queue ended but Music Dont End And Dont Show Errors.
Im Only Change Config.js To Test Bot.

If You Need My Discord: MrPerfectShot#2252

Add feature - Crossfade between songs

Describe the solution you'd like
Is it possible to make the queue crossfade to another song instead of starting a new song after the earlier song is over. Like spotify and some other music apps crossfade between songs instead of letting the earlier song end and then playing a new one.

Additional context
If it is possible, it would make the bot much better from some other busic bots...

Skipto (song queue #)

Adding this would be really cool. What this does is when you type !skipto (song queue nunber), the bot will will skip the other song(s) and play the music in the song queue number that you provided

Bug: Song playing reaction add issue!

Describe the bug
Sometimes the bot fails to add reaction to the playing message. It adds some reactions but then throws the error below and does not add reactions for some reason. The error is related to delete message. But it causes add reactions to fail.

How To Reproduce
Steps to reproduce the behavior: Its random but occurs sometimes.
1.Search something
2.Stop the last song then start a new one immediately.

Environment (add if possible)

  • Node.js version: ^12.0.x

Additional information & screenshots
In my code, no changes are made to the original code except the name of files is changed.

Here's the error, the que stops on end and everything works fine, only the reactions are not added.

DiscordAPIError: Unknown Message
    at RequestHandler.execute (D:\Other\Bot Coding\Bots\Currently Working\evobot\evobot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  method: 'delete',
  path: '/channels/718919267923263491/messages/721451579454259300/reactions',
  code: 10008,
  httpStatus: 404
}

[Image of no reactions added]
image

[Queue ends upon song end and skip command works]
image

Some small bugs

error
1.) Short YouTube links give me this error, but normal links and playlists links are fine.
Error: No playlist ID found in URL: https://youtu.be/vjhFsPNk6Po

2.) The bot sometimes stops playing music for a few seconds and then skips to the next song or ends the queue.

3.) Every once in a while it stops playing and then sends this error
HTTPError [FetchError]: request to https://discordapp.com/api/v7/channels/663187945246687232/messages failed, reason: write ECONNABORTED at RequestHandler.execute (C:\Users\USER\Documents\Discord Bots\kasumi\node_modules\discord.js\src\rest\RequestHandler.js:107:21)

[Request] Leave Command & No auto leaving when queue ends

Hello. This bot is amazing and has so many features, but would it be possible to stop the bot from disconnecting when the queue ends and instead follow in suit with Groovy whereby they have a "leave" command to disconnect the bot at any point and have an additional failsafe of disconnecting the bot after X minutes of inactivity. If this could be achieved, could this be made a configurable option to give bot owners the ability to choose whether to leave when the queue ends or remain until "leave" is entered or there's X minutes of inactivity?

Thanks!

Bug: Playlist commands can be used even when music is not playing.

Describe the bug
Although not entirely a bug, if the bot somehow fails to leave the voice channel and someone types the following commands, they still run and cause errors.

How To Reproduce
Steps to reproduce the behavior:
1.Make the bot join a channel(Sometimes the bot might not leave)
2.Use (skip, stop, resume, pause) commands

Expected behavior
The bot should respond with "There is nothing playing."

Environment (add if possible)

  • Node.js version: ^12.0.x

Additional information & screenshots
[Screenshot of executing commands while no music was playing]
Capture4

Also the resume command caused this error-

Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:266:14)
    at StreamDispatcher.Writable.write (_stream_writable.js:315:5)
    at Encoder.ondata (_stream_readable.js:717:22)
    at Encoder.emit (events.js:315:20)
    at Encoder.Readable.read (_stream_readable.js:506:10)
    at flow (_stream_readable.js:1006:34)
    at resume_ (_stream_readable.js:987:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'ERR_STREAM_WRITE_AFTER_END'
}
(node:13228) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channel' of undefined
    at Object.play (D:\Other\Bot Coding\Bots\Currently Working\evobot\src\include\play.js:10:13)
    at StreamDispatcher.<anonymous> (D:\Other\Bot Coding\Bots\Currently Working\evobot\src\include\play.js:51:26)
    at StreamDispatcher.emit (events.js:327:22)
    at finishMaybe (_stream_writable.js:639:14)
    at _stream_writable.js:616:5
    at StreamDispatcher._final (D:\Other\Bot Coding\Bots\Currently Working\evobot\src\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:248:5)
    at callFinal (_stream_writable.js:609:10)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:13228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13228) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13228) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of null
    at Encoder._transform (D:\Other\Bot Coding\Bots\Currently Working\evobot\src\node_modules\prism-media\src\opus\Opus.js:142:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:13228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

no changes were made to the code except adding additional commands which were not executed during this error...

Search command optimizations

Describe the bug

  1. Empty search query can be submitted using \search
  2. There is no way to stop the collector.
  3. The collector does not work on reply sometimes.
    4.The searhed song when played throws the error below...

How To Reproduce
Steps to reproduce the behavior:
1.Use \search command without any search query.

Expected behavior
The bot should further explain on how to use \search on giving empty query instead of executing the command.
There should be a response that can close the collector.

Environment (add if possible)

  • Node.js version: ^12.0

Also got this error upon trying to play...

(node:14416) UnhandledPromiseRejectionWarning: Error: FFmpeg/avconv not found!
    at Function.getInfo (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\prism-media\src\core\FFmpeg.js:130:11)   
    at Function.create (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\prism-media\src\core\FFmpeg.js:143:38)    
    at new FFmpeg (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\prism-media\src\core\FFmpeg.js:44:27)
    at D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\ytdl-core-discord\index.js:35:24
    at D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\ytdl-core-discord\node_modules\ytdl-core\lib\info.js:288:23
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:14416) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14416) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Also i get this error when trying to skip that

TypeError: Cannot read property 'end' of null
    at Object.execute (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\commands\skip.js:14:33)
    at Client.<anonymous> (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\index.js:50:15)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (D:\Other\Bot Coding\Bots\Currently Working\Ririchiyo Music V-0.4.0\src\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)

DJ/Voting for music control

Describe the bug
Anyone can stop or make changes to the music queue without being in the same voice channel as the bot.

How To Reproduce
Steps to reproduce the behavior:
1.Play some music in a voice channel.
2.Use another account which is not connected to any voice channel or is in a different voice channel to type !stop | !pause or other commands.

Expected behavior
The bot should reply with a message that, the bot is already being used in a different voice channel or you need to be listening to the same voice channel as the bot to use the playlist controls.

Environment (add if possible)

  • Node.js version: 12.x

Add a command to display the current playing song.

Heres one i wrote

const { MessageEmbed } = require("discord.js");
const { UI_COLOUR } = require("../config.json");
module.exports = {
    name: "np",
    description: "Show the name of the playing song.",
    execute(message) {
      const serverQueue = message.client.queue.get(message.guild.id);
      if (!serverQueue) return message.reply("There is nothing playing.").catch(console.error);

      let queueEmbed = new MessageEmbed()
      .setTitle("Now playing!")
      .setDescription(`**${serverQueue.songs[0].title}**`)
      .setURL(`${serverQueue.songs[0].url}`)
      .setColor(`${UI_COLOUR}`);

    queueEmbed.setTimestamp();
    return message.channel.send(queueEmbed);
    }
  };

Bug: Issue with skipping songs when paused.

Describe the bug
When the queue is paused and i skip the song, two songs are played after resuming.

How To Reproduce
Steps to reproduce the behavior:
1.Play a playlist
2.Pause the queue
3.Skip to a song
4.Resume the queue

Expected behavior
The song that i skipped to must be played, but the earlier message is also sent after resuming...

Environment (add if possible)

  • Node.js version: ^12.0.x

Additional information & screenshots
image

Bug play

TypeError: Cannot read property 'title' of undefined
    at Object.execute (C:\Users\boss\Downloads\evobot-master (4)\evobot-master\commands\play.js:74:40)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)

Bot not play song

Show me error i am use play + song name but not working ๐Ÿšซ Music queue ended.

Add nicknames to bot commands.

Add nicknames to bot commands so that you dont have to type the entire command. For eg- instead of !play, !volume or !skip you can type !p , !v or !s

Weird issue with skip(?)

  1. I added playlist
  2. Then skip first song
  3. I get this in error.log
ReferenceError: Cannot access 'collector' before initialization
    at StreamDispatcher.<anonymous> (C:\Users\vanawy\Desktop\vanawy-evobot\include\play.js:34:9)
    at StreamDispatcher.emit (events.js:333:22)
    at finishMaybe (_stream_writable.js:698:14)
    at _stream_writable.js:674:7
    at StreamDispatcher._final (C:\Users\vanawy\Desktop\vanawy-evobot\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:248:5)
    at callFinal (_stream_writable.js:667:10)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.