Giter Site home page Giter Site logo

melody's Introduction

Hey, I'm techy.



I'm a full-stack software and web developer from the UK.

Projects

I work on many open source projects, such as:
  • Melody, a feature-full Discord music bot.
  • Analytics, a REST API for tracking usage of my projects.
  • dns-info, an npm package for finding DNS records on a domain.
  • And many more!

Skills

I am fluent in many languages and frameworks including Java, JavaScript, HTML, CSS, Node.js, Python, and PHP. I also use libraries like React and Express to create web apps and REST APIs, along with many databases like MySQL and MongoDB for storage.




melody's People

Contributors

dependabot[bot] avatar imgbotapp avatar nerdytechy avatar peanutdumplings avatar wolfdemn 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

melody's Issues

[BUG] Unable to play YouTube links - "Could not extract stream for this track" error

Describe the bug
Whenever trying to play a YouTube link via Discord, the bot joins the voice channel, but shortly after replies in-chat with the message This media doesn't seem to be working right now, please try again later. and then leaves. In the console, the error message [Melody] ERROR: An error occurred whilst attempting to play this media: [Melody] ERROR: Error: Could not extract stream for this track is printed.

To Reproduce
Steps to reproduce the behavior:

  1. Use the /play command
  2. Enter a query containing a YouTube link
  3. Wait for the bot to join the voice channel
  4. Observe the error message in the chat and console

Expected behavior
The bot should join the voice channel and play the requested media without any errors.

Actual behavior
The bot joins the voice channel, but is unable to play the media and leaves shortly after.

Screenshots
image

Log File
https://paste.techy.lol/ldWd9RlBLY.less

Additional context
URLs tried:

  1. https://www.youtube.com/watch?v=G7KNmW9a75Y&list=PLx0sYbCqOb8Q_CLZC2BdBSKEEB59BOPUM
  2. https://www.youtube.com/watch?v=5QCBkwmsOk0

[BUG] Unexpected token at discord-player/dist/index.js:379

maximumdevmode@penguin:~/Melody/src$ node bot.js
/home/maximumdevmode/Melody/node_modules/discord-player/dist/index.js:379
return data?.url ?? data?.thumbnail?.url ?? null;
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/maximumdevmode/Melody/src/bot.js:3:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
maximumdevmode@penguin:~/Melody/src$

[BUG] Bot stops playing after about 50 seconds

When I request a song, it plays the song specified for 50ish seconds (seems to usually be around 55 seconds). After that time has elapsed, the bot stops playing. (Since the music counts as stopped, it automatically disconnects, but that's just normal behaviour)

Steps to reproduce the behaviour:

  1. Join a voice channel
  2. Use "/play query:" where can be any valid YouTube video link. The bot should join the voice channel you are currently in.
  3. Wait until the music stops playing. This should take at most 60 seconds. (If this fails to occur, I don't know what to do)
  4. The bot should leave the channel after about 10-15 seconds, since the bot is inactive. (This last step is normal behaviour for the bot as far I know)

The expected behaviour of the bot is for it play each requested song through to completion, then leave.

The actual behaviour of the bot is that it each song requested is only partially played before being halted, and then the bot leaves.

Additional context:
If I run the "resume" function, it states that it has unpaused the music, but does it not continue. All other functions (stop, nowplaying, etc) still work.

[BUG] /Seek on YouTube plays for half a second and then disconnects

Describe the bug
When playing a long youtube video on the bot and seeking to a specific place on the bot, The bot will seek to said location and then immidiatly disconnect
To Reproduce
Steps to reproduce the behaviour:

  1. Play long youtube video with /play
  2. /Seek more than 10 minutes into the video
  3. Error Reproduced here

Expected behaviour
To play youtube videos and seek to a specific part in said video

Actual behaviour
Seeking to a part in a video disconnects the bot

Screenshots
image

[BUG] Could not extract stream for this track

Hello, I'm the one who loaded your music bot to use. and i have a problem to report I can't play music through your bot even though I put everything in the right config and the bot shows that it's active and accepting commands. I hope you check it out. Thanks a lot.

melodybug

[BUG] /play command unable to find linked YouTube content

Description:
The /play command is unable to find valid YouTube links provided as input. Instead, it returns the error message "I couldn't find anything with the name [query]." The bot also does not join the voice channel to play music, even if the command is executed with a valid YouTube link.

Steps to Reproduce:

  1. Enter a voice channel.
  2. Use the command /play query: https://www.youtube.com/playlist?list=PLx0sYbCqOb8Q_CLZC2BdBSKEEB59BOPUM or /play query: https://www.youtube.com/watch?v=XgZ4-XPFFE8.
  3. See the error message "I couldn't find anything with the name [query]."

Expected Result:
The bot should recognize valid YouTube links and join the voice channel to play the linked content.

Actual Result:
The bot returns an error message for valid YouTube links and does not join the voice channel to play music.

Screenshots:
image

Log File:
https://paste.techy.lol/Cvh81n7a0X.sql

Additional Context:
I am using a custom cookie and everything else default.

[BUG] Unable to Play Songs from Spotify Link or Query

Describe the bug
When using the "/play" command with a Spotify link, the error message "This media doesn't seem to be working right now, please try again later." is displayed instead of playing the song.

To Reproduce
Steps to reproduce the behaviour:

  1. Use the "/play" command
  2. Enter the query "query: https://open.spotify.com/track/5R4iVNGhdMwNQydS5lUUGa" (Auto completed from Lilliana Wilde - White Rabbit)
  3. See the error message "This media doesn't seem to be working right now, please try again later."

Expected behaviour
I expected the bot to play the song from the provided Spotify link.

Actual behaviour
The bot returned an error message "This media doesn't seem to be working right now, please try again later." and did not play the song.

Screenshots
image

Log File
Unfortunately, I do not have the log file at the moment.

Additional context
N/A

[BUG] Instant disconnection from voice channel upon /play command

Describe the bug

The bot joins voice channel, adds music to its queue, then instantly disconnects.

To Reproduce
Steps to reproduce the behaviour:

  1. Clone repository, install dependencies,
  2. Copy config.example.yml to config.yml and add private tokens,
  3. Run npm start,
  4. Use /play to play any song in a voice channel.

Expected behaviour
The bot joins my voice channel and starts playing music.

Actual behaviour
The bot joins my voice channel and it instantly disconnects, returning the following message:

The music was stopped because I was disconnected from the channel.

Screenshots
bot-bug

Log File
Log file,
Config file.

Additional context
None.

ERROR: TypeError: Cannot read properties of undefined (reading 'split')

Node JS Version 18.16.0

[Melody] WARNING: Unable to find data.json file. Creating a new one with default values.
[Melody] INFO: Initialising Melody...
[Melody] INFO: Reloading application commands...
[Melody] INFO: Logging into Discord client...
[Melody] SUCCESS: Successfully reloaded application commands.
[Melody] SUCCESS: Logged in as Jedag Jedug#5464 (1166100720794222722)
[Melody] SUCCESS: Melody is now ready.
[Melody] INFO: Melody is in 1 server.
(node:388779) [DeprecationWarning] Warning: useMasterPlayer() hook is deprecated, use useMainPlayer() instead.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:388779) [DeprecationWarning] Warning: useMasterPlayer() hook is deprecated, use useMainPlayer() instead.
(node:388779) [DeprecationWarning] Warning: useMasterPlayer() hook is deprecated, use useMainPlayer() instead.
(node:388779) [DeprecationWarning] Warning: useMasterPlayer() hook is deprecated, use useMainPlayer() instead.
[Melody] ERROR: An unhandled rejection occurred in the main process:
[Melody] ERROR: TypeError: Cannot read properties of undefined (reading 'split')
    at setCookieToken (/root/Melody/node_modules/play-dl/dist/index.js:1:1820)
    at Object.setToken (/root/Melody/node_modules/play-dl/dist/index.js:15:2534)
    at _YoutubeExtractor._stream (/root/Melody/node_modules/@discord-player/extractor/dist/index.js:201:12)
    at _YoutubeExtractor.stream (/root/Melody/node_modules/@discord-player/extractor/dist/index.js:659:17)
    at /root/Melody/node_modules/discord-player/dist/index.js:2502:28
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _ExtractorExecutionContext.run (/root/Melody/node_modules/discord-player/dist/index.js:1159:22)
    at async #createGenericStream (/root/Melody/node_modules/discord-player/dist/index.js:2496:22)
    at async _GuildQueuePlayerNode.play (/root/Melody/node_modules/discord-player/dist/index.js:2399:9)
    at async Object.execute (/root/Melody/src/commands/Player/play.js:73:41)

[BUG] Bot disconnects itself before playing the song

Describe the bug
When the user uses the /play command the bot disconnects itself before playing the song

To Reproduce
Steps to reproduce the behaviour:

  1. Start the bot
  2. Use the /play command
  3. See error

Expected behaviour
The bot plays the song normally

Actual behaviour
The bot says that it was disconnected and in the console there is this warning: (node:243730) [DeprecationWarning] Warning: useMasterPlayer() hook is deprecated, use useMainPlayer() instead.

[FR] Docker Support

Is your feature request related to a problem? Please describe.
Create a docker image for new users to test/use this music bot via docker containers. I have been looking for a good music bot that has slash commands and react buttons for a "now playing" message from the bot to allow ease of use. Using docker has been a great way to quickly test and deploy discord bots.

"Working" Solution
I pulled the repo, modified the config.yml with bot info, then added a Dockerfile (which was mainly based off of nizewn/Dodong Discord Music Bot):

FROM node:18-alpine AS BUILD
WORKDIR /build
COPY . /build
RUN npm install --production

FROM node:18-alpine
LABEL MAINTAINER="melody" DESCRIPTION="Discord music bot with many useful commands and effects."
WORKDIR /bot
COPY --from=BUILD /usr/lib/ /usr/lib/
COPY --from=BUILD /lib/ /lib/
COPY --from=BUILD /build/ /bot
ENV NODE_ENV production
CMD ["node", "./src/bot.js"]

Created an image using docker build -t melody . then created a container docker run -d -it --name melody --restart unless-stopped melody

Describe the solution you'd like
I am not an expert at docker but a better way would be either passing in the bot token as a environment variable or mapping of a working volume for docker.

codetheweb/muse Discord Music Bot has an example of using environment variable.

Bas-Korver/docker-jmusicbot is an example of someone making a docker version of jmusicbot by basically mapping the directory of the config file for the bot with docker-compose.

Again, I am no expert at docker and mainly get by with scraping together information from different github docker projects.

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.