Code Monkey home page Code Monkey logo

brblacky / lavamusic Goto Github PK

View Code? Open in Web Editor NEW
545.0 11.0 476.0 9.33 MB

lavalink music bot base in shoukaku and discord.js v14

Home Page: https://appujet.github.io/lavamusic/

License: GNU General Public License v3.0

TypeScript 99.09% Nix 0.07% Dockerfile 0.51% Batchfile 0.01% JavaScript 0.32%
youtube spotify soundcloud- lavaplayer discord-bot discord-js discord-music-bot lavalink-musicbot lavalink music-bot-discord music-bot discord bot lavamusic- nodejs music lavalink-music lavalink-music-bot discord-js-v14 shoukaku

lavamusic's Issues

mongo

}
MongoParseError: Invalid connection string ""
    at new ConnectionString (C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongodb-connection-string-url\lib\index.js:66:19)
    at parseOptions (C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongodb\lib\connection_string.js:210:17)
    at new MongoClient (C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongodb\lib\mongo_client.js:62:63)
    at C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongoose\lib\connection.js:779:16
    at new Promise (<anonymous>)
    at NativeConnection.Connection.openUri (C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongoose\lib\connection.js:776:19)
    at C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongoose\lib\index.js:332:10
    at C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongoose\lib\helpers\promiseOrCallback.js:32:5
    at new Promise (<anonymous>)
    at promiseOrCallback (C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:10)

Not playing music directly from spotify

in the latest changes it should play music directly from spotify... but it doesn't work, it always plays music from youtube modifying the message sent with the spotify metadata

24/7?

how bot kept running on replit?

Some Features

Add some features like :

Lyrics Command 👍
Search Command 👍

Sir can you add autoconnect and textchannel configuration

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Spotify [ Track & Playlist ]

Describe the bug
When i add the duration of spotify track or playlist, the duration in the playing message appear NaN:NaN:NaN.

Screenshots
Capture

cannot read property of null (reading 'title')

TypeError: Cannot read properties of null (reading 'title')
at Object.execute (/var/lib/pufferpanel/servers/6a3aa38e/src/commands/Music/queue.js:28:70)
at module.exports (/var/lib/pufferpanel/servers/6a3aa38e/src/events/Client/messageCreate.js:89:17)
at MusicBot.emit (node:events:390:28)
at MessageCreateAction.handle (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/client/actions/MessageCreate.js:25:14)
at Object.module.exports [as MESSAGE_CREATE] (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/client/websocket/WebSocketManager.js:350:31)
at WebSocketShard.onPacket (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/client/websocket/WebSocketShard.js:443:22)
at WebSocketShard.onMessage (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/client/websocket/WebSocketShard.js:300:10)
at WebSocket.onMessage (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:390:28)

Add multiple lavalink

• add multiple lavalink server support
• add more command
• add dropdown help menu

32 bit integer

node:19054) TimeoutOverflowWarning: 9223372036854776000 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
(Use node --trace-warnings ... to show where the warning was created)

Fix Socket has been closed because Session is no longer valid.

Go to : events/Lavalink/socketClosed.js
Old :
`module.exports = async (client, player, payload) => {

if (payload.byRemote == true) {
    player.destroy();
}

client.logger.log(`Socket has been closed because ${payload.reason} in [${player.guild}]`, "error");

}
`

Edit :

`module.exports = async (client, player, payload) => {

console.error();

}
`

play command using ! does not work

Describe the bug
No response in discord, log gives an error:

[06-12-2021 06:46:19]: [CMD] Client Application (/) Registered.
DiscordAPIError: Invalid Form Body
embeds[0].description: This field is required
    at RequestHandler.execute (/home/stefan/musicbot-lavalink/lavamusic/node_modules/discord.js/src/rest/RequestHandler.js:349:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/stefan/musicbot-lavalink/lavamusic/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
    at async TextChannel.send (/home/stefan/musicbot-lavalink/lavamusic/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:172:15) {
  method: 'post',
  path: '/channels/466673053208674315/messages',
  code: 50035,
  httpStatus: 400,
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [Array],
      components: undefined,
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    },
    files: []
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Setup the bot
  2. Type !join (-> the bot joins your voice channel)
  3. Type !play a (the issue appears)

Expected behavior
Some audio starts playing, no error

Additional context
The culprit looks to me like missing curly braces around the 2 statements

Typo

src/events/Lavalink/trackStart.js
line 75

if(amount >= 110)
if you keep that 200 the vup button will increase the volume till 200
and if you keep 100 it wont go above 90 so change it to 110

Bot disconnect if moved to another channel

If u try to move the bot to another channel the socket close and throw message in console that has been close and automatically leave channel. I have try this into socketClosed.js :

module.exports = async (client,player,payload ) => {

if (payload.byRemote == true) {
    

    player.state == "CONNECTED"
    player.pause(false);
    return;
}

client.logger.log(`Socket has been closed because ${payload.reason} in [${player.guild}]  ${payload.code} ` , "error");

}

So now if u move the bot the music continue but the other command doesnt work ( throw the message " You arent in the same channel as the bot") . any idea how to fix?

Make nowplaying embeds pop up in recent channel you sent a play command in

Is your feature request related to a problem? Please describe.
Not a problem just a bit helpful

Describe the solution you'd like
The now playing embeds are locked to the player channel. It should switch to the last channel a play command was sent in

Describe alternatives you've considered
Tried adding player.setTextChannel(message.channel.id) before the message is sent for nowplaying in trackStart.js. didn't work for me though

GUM7EDklIf.mp4

Erela.js "No Avaliable Nodes." RangeError

I've transfer the files to my bot as I forked this, and configure the event handler and error comes out:

/workspace/node_modules/erela.js/dist/structures/Player.js:82
            throw new RangeError("No available nodes.");
                  ^

RangeError: No available nodes.
    at new Player (/workspace/node_modules/erela.js/dist/structures/Player.js:82:19)
    at Manager.create (/workspace/node_modules/erela.js/dist/structures/Manager.js:205:16)
    at Object.run (/workspace/commands/music/play.js:23:49)

Any way to fix this?

mongoose

problem 1

MongooseError: Operation prefixes.findOne() buffering timed out after 10000ms
at Timeout. (C:\Users\abelp\Desktop\lavamusic-main\node_modules\mongoose\lib\drivers\node-mongodb-native\collection.js:149:23)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)

/help does not work in direct messages - An unexcepted error occured.

Describe the bug
/help does not work in direct messages

To Reproduce
Steps to reproduce the behavior:

  1. Send the bot a direct message /help
  2. It responds with An unexcepted error occured.

Expected behavior
Help is printed :)

Desktop (please complete the following information):

  • OS: Manjaro
  • Browser Discord Client
  • Version Stable 106905 (1eb8c0f) Host 0.0.16

Additional context
TypeError: Cannot read properties of null (reading 'user') at Object.run (/home/stefan/musicbot-lavalink/lavamusic/src/slashCommands/Information/help.js:19:54) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async module.exports (/home/stefan/musicbot-lavalink/lavamusic/src/events/Client/interactionCreate.js:41:13) {stack: "TypeError: Cannot read properties of null (reading…sic/src/events/Client/interactionCreate.js:41:13)", message: "Cannot read properties of null (reading 'user')"}

The issue seems to be interaction.member being null in https://github.com/brblacky/lavamusic/blob/f8641cc06f4301545c491f4a03e8e5a249599b75/src/slashCommands/Information/help.js#L17

Error

Error: Cannot find module 'node:events'
Require stack:

  • /home/runner/lavamusic/node_modules/discord.js/src/client/BaseClient.js
  • /home/runner/lavamusic/node_modules/discord.js/src/index.js
  • /home/runner/lavamusic/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/home/runner/lavamusic/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    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) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/runner/lavamusic/node_modules/discord.js/src/client/BaseClient.js',
    '/home/runner/lavamusic/node_modules/discord.js/src/index.js',
    '/home/runner/lavamusic/index.js'
    ]
    }

im getting this error i have the index.js file but its sayin this

Bot Disconnects instantly, No playing song

[LOG] Player has been created in 833731920944824341
[LOG] Player has been destroyed in 833731920944824341
[ERROR] Socket has been closed because Session is no longer valid. in [833731920944824341]

GuildDelete error

DiscordAPIError: Missing Access
at RequestHandler.execute (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/rest/RequestHandler.js:349:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
at async GuildMemberManager._fetchSingle (/var/lib/pufferpanel/servers/6a3aa38e/node_modules/discord.js/src/managers/GuildMemberManager.js:388:18)
at async module.exports (/var/lib/pufferpanel/servers/6a3aa38e/src/events/Client/guildDelete.js:7:13) {
method: 'get',
path: '/guilds/860203790426570812/members/809213892857167942',
code: 50001,
httpStatus: 403,
requestData: { json: undefined, files: [] }

Question/Suggestion

Are you looking forward into changing Ksoft.Si API for lyrics to something else. Beacause not only you can not make an new API but their lyrics endpoints are gone and they are not looking forward into re-using them.
That means that the lyrics command will be useless with Ksoft.Si API.

Add Heroku Support

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
Please add heroku support for this bot,it'll easy to maintain the server

Syntax Error on Start

Describe the bug
Bot Won't Start

To Reproduce
Steps to reproduce the behavior:
N/A

Expected behavior
The bot would start without a syntax error.

Screenshots
Screen Shot 2021-11-28 at 1 36 38 pm

Additional context
It may be worth noting that several commands have been disabled by the use of appending the files with .off

Bot doesn't check whether it can actually join a vc

Describe the bug
Bot doesn't check whether it's in a vc / can actually join a vc

To Reproduce
Steps to reproduce the behavior:

  1. Play music in a vc where the bot has permission to join
  2. Leave the vc
  3. Manually disconnect bot or delete the channel
  4. Join a vc the bot doesn't have permission to join
    image
  5. Type join command
  6. The bot says
    image
    but doesn't join vc. It still shows now playing and lets you queue songs.

Expected behavior
Bot should say it is unable to join the vc and not start a player

Note
When this errror occurs the only way to fix is restart entire bot

cEU81f2c3X.mp4

error in playerMove.js

Describe the bug
data: index.js:16886 - [29-11-2021 06:46:47]: [LOG] Player has been destroyed in 890983793622667274
data: index.js:16886 - ReferenceError: message is not defined
data: index.js:16886 - at module.exports (/root/og/src/events/Lavalink/playerMove.js:6:9)
data: index.js:16886 - at processTicksAndRejections (node:internal/process/task_queues:96:5)

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

Expected behavior
Send "Music stopped as I have been disconnected from the voice channel." message in player channel.

Bot stop working after update 1.0.3 ...

1#
after update bot don't use prefix.. only slashcommand.

2#
Spotify stop to working.

3#
When I move the bot from a channel without any... (so with the music stopped but with the queue active) in my channel... it doesn't automatically resume playing

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.