Giter Site home page Giter Site logo

mindaugaskasp / discord-music-bot Goto Github PK

View Code? Open in Web Editor NEW
59.0 4.0 62.0 104 KB

Node.js / Discord.js / Discord.js-Commando based bot solely for the purpose of playing audio stream to Discord

License: MIT License

JavaScript 99.14% Dockerfile 0.86%
music-playback songs discord-application discord-music-bot discord-youtube discord-listen-moe youtube-bot listen-moe-bot discord-music discord-bot

discord-music-bot's Introduction

discord-music-bot

NOT IN ACTIVE DEVELOPMENT AND MAY CONTAIN ISSUES & BUGS

Music bot for Discord voip app, contains only music playback code and no other unnecessary overhead code. Free to fork and/or contribute.

Clone master branch for the stable version. Any bug reports or security concerns are very welcomed, please, open a ticket and I will address it shortly.

Local set up guide

  1. Install ffmpeg for your local machine, so it can be accessed by the bot
  2. Install Node (>=8.6) and NPM
  3. Clone repository and change your terminal working dir to it
  4. Run cp configs/app.example.json configs/app.json and set access tokens in configs/app.json file
  5. Run npm install (not necessary for docker set up)
  6. Add bot to your discord guild by using link https://discordapp.com/oauth2/authorize?client_id=<ClientID>&permissions=36728128&scope=bot, where <clientID> is your Discord Application client ID of the application whose token you've set in app.json file (be very cautious what kind of permissions you assign to your bot in case of security breach)
  7. Run npm run prod (not necessary for docker set up)

Docker set up guide

  1. Clone repository
  2. Run cp configs/app.example.json configs/app.json and set access tokens in configs/app.json file
  3. Run docker-compuse up --build to build and run your container

Available commands

Refer to [prefix]help command for available commands. Prefix can be set in configs/app.json file, by default it is . (dot)

Dependencies

  • discord.js-commando
  • ffmpeg

discord-music-bot's People

Contributors

haydar1998 avatar mindaugaskasp avatar

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

Watchers

 avatar  avatar  avatar  avatar

discord-music-bot's Issues

Bot allows "playing" audio twice, leading to a myriad of unexpected results.

Describe the bug
If the bot is sent a play command while already in a state where it's playing (or trying to play) audio, it will accept this command and this will lead to all sorts of weird behavior (stuttered warbly audio, error messages in console and nonsensical output in Discord, etc.).

To Reproduce
Steps to reproduce the behavior:

  1. Have the bot join a channel.
  2. Queue up a single YouTube video with the get command.
  3. Send the bot a play command.
  4. Send the bot another play command.
  5. Discord channel plays a stuttered/warbly version of the audio, and the bot spazzes out in the text channel., either immediately or after some time (possibly depending on length of audio and/or Internet connection speed).

Expected behavior
If the play command is already playing something, prevent the user from playing again and inform the user via Discord messages that nothing will be done because a stream is already playing.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac OSX Mojave 10.14.3

Additional context
I found this bug when trying to play a long YouTube video. I'd assumed that it wasn't working on the the first attempt, so I tried again with a second play command. The second attempt played, but it cut short (possibly playing a partially-downoaded file?). Then, at some point (where the full file seems to have apparently been downloaded), the audio started playing, but warbly and choppy. It seems that the play process was being run twice, with the two instances of the process interacting with one another in strange ways.

NOTE: Possibly related to #7 , with the root issue from a user perspective being no indication of progress for downloading longer files before playing them back.

token leak

Just want to remind you that any token being committed can still be find after you have edited the post. So go a head and renew the tokens if you haven't.

Videos With Strange Characters In Title Won't Play

Describe the bug
Videos are downloaded with strange characters in the title included, and playback won't start (presumably because the module responsible for loading files can't read them).

Screenshots
files with funky characters

To Reproduce
Steps to reproduce the behavior:

  1. Start the bot.
  2. Connect the bot to a voice channel.
  3. Send message .get https://www.youtube.com/watch?v=oK8OkdsKXR8.
  4. Send message .play.
  5. Bot gives a "playing" response in Discord, but no audio plays in the voice channel and no errors appear in console.

Expected behavior
YouTube videos play regardless of whether their titles contain funky characters.

Desktop (please complete the following information):

  • OS: Mac OSX Mojave 10.14.3

Related issues:
Related to #8 , as both seem to be related to the translating data to the local filesystem.

Downloads are saved in project directory with backslash characters as part of the filename.

Describe the bug
Downloads are saved in project directory with backslash characters as part of the filename.

To Reproduce
Steps to reproduce the behavior:

  1. Have the bot play a specific YouTube video that it hasn't played before.
  2. File is downloaded into project directory rather than downloads sub-directory, with backslashes and other special characters as a part of the literal filename.

Expected behavior
File is stored in downloads directory, special characters are otherwise escaped.

Screenshots
directory screenshot

Desktop (please complete the following information):

  • Mac OSX Mojave 10.14.3

Play Command Doesn't Work On First Attempt

Describe the bug
When given a single YouTube video to play, the play command needs to be run twice before playback is actually heard in-channel.

To Reproduce
Steps to reproduce the behavior:

  1. Start server.
  2. Use the join command to have the bot join a voice channel (e.g., General).
  3. Add a video (e.g., https://www.youtube.com/watch?v=VCrQ3EU8_PM) with the get command.
  4. Play the video with the play command.
  5. No audio for an extended period of time, no errors in server console.
  6. Try the play command again.
  7. Bot starts to play audio in channel.

Expected behavior
Play command works on first attempt.

Desktop (please complete the following information):

  • OS: Mac OSX Mojave 10.14.3

Additional context
ffmpeg installed via brew on OSX

discord-helpers/integrations/youtube

when I try to run the bot it says:

module.js:550
throw err;
^

Error: Cannot find module 'discord-helpers/integrations/youtube'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\Student\Downloads\discord server\commands\get.js:2:17)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)

Can someone help?

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.