Giter Club home page Giter Club logo

vulkan's Introduction

Vulkan

A Music Discord Bot, that plays Youtube, Spotify, Deezer links or raw queries. Vulkan is open source, so everyone can fork this project, follow the instructions and use it in their own way, executing it in your own machine or hosting in others machines to work 24/7.

Vulkan uses multiprocessing and asynchronous Python modules to maximize Music Player response time, so the player doesn't lag when many commands are being processed and it can play in multiples discord serves at the same time without affecting the Music Player response time.

Music ๐ŸŽง

  • Play musics from Youtube, Spotify and Deezer links (Albums, Artists, Playlists and Tracks).
  • Play musics in multiple discord server at the same time.
  • The player contains buttons to shortcut some commands.
  • Support for the new Discord Slash commands.
  • Search for all musics in Queue using buttons.
  • Shortcut the playing of one song using dropdown menu.
  • Manage the volume of the songs.
  • Manage the loop of one or all playing musics.
  • Manage the order and remove musics from the queue.
  • Shuffle the musics queue order.
  • Automatically clean the sended messages so it doesn't fill up your server.



Setting up for yourself

Requirements

Installation of Python 3.10+ and the dependencies in the requirements.txt file, creation of your own Bot in Discord and Spotify Keys.
To install the dependencies type this command in the terminal, in the project root folder.

pip install -r requirements.txt

๐Ÿ”‘ API Keys

You have to create your own discord Bot and store your Bot Token

  • Your Discord Application - Discord

  • You own Spotify Keys - Spotify

    • This information must be stored in an .env file, explained further.

Installation of FFMPEG

FFMPEG is a module that will be used to play music, you must have this configured in your machine FFMPEG must be configured in the PATH for Windows users. Check this YoutubeVideo.

You can download the executables in this link https://www.ffmpeg.org/download.html and then put the .exe files inside a ffmpeg\bin folder in your C:\ folder. Do not forget to add 'ffmpeg\bin' to your PATH.

.Env File Example

This is an example of how your .env file (located in root) should look like.

BOT_TOKEN=Your_Own_Bot_Token
SPOTIFY_ID=Your_Own_Spotify_ID
SPOTIFY_SECRET=Your_Own_Spotify_Secret
BOT_PREFIX=Your_Wanted_Prefix_For_Vulkan
SHOULD_AUTO_DISCONNECT_WHEN_ALONE=True #all settings can be set like this
#etc... All settings can be set this way

โš™๏ธ Configs

The bot's configuration is stored in the .env file, you can change the prefix and the bot token there, as well as all the other configurations. Take a look in the Settings page to personalize the Bot for you.

Initialization

  • Go to Discord and invite your Bot to your own server
  • Run python main.py in console to start
  • Give this project a nice ๐ŸŒŸ

๐Ÿณ Docker

You can also run this project in a Docker container. You can find the instructions to run this project in a Docker container in the Docker Instructions page.




๐Ÿš€ Heroku (Not free anymore)

Heroku doesn't offer free host services anymore.

To deploy and run your Bot in Heroku 24/7, follow the instructions in the Heroku Instructions page.

๐Ÿงช Tests

The tests were written manually with no package due to problems with async function in other packages, to execute them type in root:
python run_tests.py

๐Ÿ“– License

This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.

๐Ÿ—๏ธ Contributing

If you are interested in upgrading this project i will be very happy to receive a PR or Issue from you. See TODO project to see if i'm working in some feature now.

vulkan's People

Contributors

paillat-dev avatar rafaelsolvargas avatar rivai45 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vulkan's Issues

[Suggestion] Soundcloud and Local File support

Absolutely love this bot, I previously used JMusicBot for years which wasn't holding up to Youtube's changes very well. They had SC and local file support, which the people that use my bot used often. From what I've tried myself and what my bot users tell me, it ignores local files under the play command and Soundcloud links return a "nothing found" error.
Is there a command I'm forgetting about for playing local files? If not could support for both SC and local files be implemented in the future?

bot not showing music commands

Describe your context
The Vulkan contains some configuration parameters set up in the Configs/Config.py file, tell us what values you are using.
everything is default only removed spotify clint id and secret line

The path to the bug
Don't forget to specify how you found the issue, what Discord commands you used and which was the parameters passed.
when i try to give command to the bot i cant play songs screenshot attached
Screenshots
Screenshots of the error thrown or the Bot messages will help us to fix you issue faster.
photo_2024-01-10_16-47-26

.env

i made a .env to the root but it still asks for it. i also renamed it to conf.env but still says i need to set it. cant find the help documentation on what the filename should be.

ffmpeg on heroku fails

i dont know whats to do here.

2022-07-31T21:35:23.471246+00:00 app[worker.1]: Starting Vulkan...
2022-07-31T21:35:23.471642+00:00 app[worker.1]: Vulkan is now operating.
2022-07-31T21:35:31.581494+00:00 app[worker.1]: Starting Process =test=
2022-07-31T21:35:32.721234+00:00 app[worker.1]: [ERROR IN PLAY SONG] -> ffmpeg was not found., <class 'discord.errors.ClientException'>
2022-07-31T21:35:32.727022+00:00 app[worker.1]: Exception ignored in: <function AudioSource.del at 0x7fec77d57910>
2022-07-31T21:35:32.727036+00:00 app[worker.1]: Traceback (most recent call last):
2022-07-31T21:35:32.727051+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord/player.py", line 127, in del
2022-07-31T21:35:32.727137+00:00 app[worker.1]: Process =test= sended command VCommandsType.SLEEPING
2022-07-31T21:35:32.727281+00:00 app[worker.1]: self.cleanup()
2022-07-31T21:35:32.727294+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord/player.py", line 247, in cleanup
2022-07-31T21:35:32.727431+00:00 app[worker.1]: self._kill_process()
2022-07-31T21:35:32.727443+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord/player.py", line 198, in _kill_process
2022-07-31T21:35:32.727561+00:00 app[worker.1]: proc = self._process
2022-07-31T21:35:32.727604+00:00 app[worker.1]: AttributeError: 'FFmpegPCMAudio' object has no attribute '_process'

C:\Users\test\Desktop\Vulkan-1.4>heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
ยป Error: The buildpack https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git is already set on your app.

C:\Users\test\Desktop\Vulkan-1.4>heroku buildpacks:add --index 1 https://github.com/xrisk/heroku-opus.git
ยป Error: The buildpack https://github.com/xrisk/heroku-opus.git is already set on your app.

C:\Users\test\Desktop\Vulkan-1.4>heroku buildpacks
=== droopiediscordbot Buildpack URLs

  1. heroku/python
  2. https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
  3. https://github.com/xrisk/heroku-opus.git

C:\Users\test\Desktop\Vulkan-1.4>

The bot is spamming messages

It looks like that when loop=all is selected, at some point, it starts skipping all songs and sending each song in the queue without stopping, like if the songs were 0 seconds long.
I unforunately haven't any screenshot because I cleared the channel.

Bug

PS F:\code\Java\Music-KS> npm install -r requirements.txt
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/requirements.txt - Not found
npm ERR! 404
npm ERR! 404 'requirements.txt@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\beau0\AppData\Local\npm-cache_logs\2023-07-06T02_33_15_980Z-debug-0.log

I don't know why

Player Skips Mid Song

The player will skip mid song. I believe this might be an issue with ffmpeg via yt-dlp, but I'm not totally sure. The bot will stop mid song, and skip to the next one in the queue.

Details: Running in a Heroku Hobby Dyno

The following log shows where the first error happens at 15:34:38 with Error in the pull function, Connection reset by peer, then automatically skips to the next track with VCommandsType.NOW_PLAYING, and repeats the error again at 15:38:33.

2022-10-15T15:34:38.097519+00:00 app[worker.1]: [tls @ 0x5c54340] Error in the pull function.
2022-10-15T15:34:38.097535+00:00 app[worker.1]: [tls @ 0x5c54340] IO error: Connection reset by peer
2022-10-15T15:34:38.097538+00:00 app[worker.1]: [https @ 0x5c507c0] Will reconnect at 3457008 in 0 second(s), error=Connection reset by peer.
2022-10-15T15:34:40.679849+00:00 app[worker.1]: Process Divide sended command VCommandsType.NOW_PLAYING
2022-10-15T15:38:33.697499+00:00 app[worker.1]: [tls @ 0x69ff340] Error in the pull function.
2022-10-15T15:38:33.697519+00:00 app[worker.1]: [tls @ 0x69ff340] IO error: Connection reset by peer
2022-10-15T15:38:33.697521+00:00 app[worker.1]: [https @ 0x69fb7c0] Will reconnect at 3686384 in 0 second(s), error=Connection reset by peer.
2022-10-15T15:38:35.745925+00:00 app[worker.1]: Process Divide sended command VCommandsType.NOW_PLAYING

Bot stop responding after some time

I noticed that after some time without receiving any commands, the bot has problems determining whether or not it is connected to a voice channel, like the error below, thrown while the bot was connected to the voice channel, the solution was to restart it, but this is a bug that could be fixed by setting up some sort of automatic disconnect after some time, forcing the bot to reconnect when receiving another command.

a81fe27c-ccb1-4599-bc3b-eefd3ec9fe8e

no audio

i hit that !play link in chat and all the messages get posted with buttons and all but no audio when the bot joins the channel. ran the log and i only see this

2022-07-31T21:57:10.518563+00:00 heroku[worker.1]: Restarting
2022-07-31T21:57:10.532088+00:00 heroku[worker.1]: State changed from up to starting
2022-07-31T21:57:11.162954+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2022-07-31T21:57:11.534332+00:00 heroku[worker.1]: Process exited with status 0
2022-07-31T21:57:14.580870+00:00 heroku[worker.1]: Starting process with command python main.py
2022-07-31T21:57:15.000000+00:00 app[api]: Build succeeded
2022-07-31T21:57:15.188259+00:00 heroku[worker.1]: State changed from starting to up
2022-07-31T21:57:18.145757+00:00 app[worker.1]: Starting Vulkan...
2022-07-31T21:57:18.146145+00:00 app[worker.1]: Vulkan is now operating.
2022-07-31T21:57:27.037497+00:00 app[worker.1]: Starting Process =TeaBaggers United=
2022-07-31T21:57:28.420013+00:00 app[worker.1]: Process =TeaBaggers United= sended command VCommandsType.NOW_PLAYING
2022-07-31T21:57:28.421411+00:00 app[worker.1]: Process =TeaBaggers United= sended command VCommandsType.SLEEPING
2022-07-31T21:58:52.702273+00:00 app[worker.1]: Ignoring exception in view for item <PlayButton style=<ButtonStyle.secondary: 2> url=None disabled=False label='Play' emoji= row=None>:
2022-07-31T21:58:52.702766+00:00 app[worker.1]: Traceback (most recent call last):
2022-07-31T21:58:52.702790+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord/ui/view.py", line 375, in _scheduled_task
2022-07-31T21:58:52.702791+00:00 app[worker.1]: await item.callback(interaction)
2022-07-31T21:58:52.702798+00:00 app[worker.1]: File "/app/UI/Buttons/PlayButton.py", line 17, in callback
2022-07-31T21:58:52.702799+00:00 app[worker.1]: response = await handler.run()
2022-07-31T21:58:52.702806+00:00 app[worker.1]: File "/app/Handlers/ResumeHandler.py", line 21, in run
2022-07-31T21:58:52.702807+00:00 app[worker.1]: queue.put(command)
2022-07-31T21:58:52.702814+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/multiprocessing/queues.py", line 88, in put
2022-07-31T21:58:52.702815+00:00 app[worker.1]: raise ValueError(f"Queue {self!r} is closed")
2022-07-31T21:58:52.702828+00:00 app[worker.1]: ValueError: Queue <multiprocessing.queues.Queue object at 0x7f1b10df2080> is closed

Bug

Describe your context
when i use /play with spotify or youtbe all configs a correte the spotify keys are corret

The path to the bug
[notice] A new release of pip is available: 23.0.1 -> 23.1.2
[notice] To update, run: pip install --upgrade pip
Starting Vulkan...
Vulkan is now operating.
Starting Player Process for Guild Xenority
[PROCESS PLAYER -> CONNECTING TO VOICE CHANNEL]
Player Process Xenority received command VCommandsType.PLAY
Process Xenority sended command VCommandsType.NOW_PLAYING
[https @ 0x564e352f5b00] HTTP error 403 Forbidden
https://rr5---sn-4g5lzned.googlevideo.com/videoplayback?expire=1687700577&ei=AfCXZKrnB9CxgQf37LHwCQ&ip=148.251.48.2&id=o-AB-j1mrF6pxNPMKqUPvnDdhSw6vRC5UwekywEzZ5gLuE&itag=251&source=youtube&requiressl=yes&mh=kw&mm=31%2C29&mn=sn-4g5lzned%2Csn-4g5edn6y&ms=au%2Crdu&mv=m&mvi=5&pl=24&gcr=de&initcwndbps=611250&spc=qEK7B9pFiShMiqHEqN28qLizBEXD1U1La7iZuRaflg&vprv=1&svpuc=1&mime=audio%2Fwebm&gir=yes&clen=1683444&dur=108.721&lmt=1669743262388535&mt=1687678614&fvip=2&keepalive=yes&fexp=24007246%2C24363391&beids=24350018&c=ANDROID&txp=5318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAJQJtGZg9et53wpCOdT5knBmKvTtXRjciQAi5xwzkFGnAiEAqJW0E1mVWO2T5-zMY2lTYOdGJwWe1dUcEAWhSTGQK4g%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgPVhxOtMeQ8NCFQ2H5Q2s5NXcSkCRZqYmWbokaNFowh4CIAwoUIQ6kTFcCClcLXxWx6EtLcsITJI8yfjUBSp3_1zl: Server returned 403 Forbidden (access denied)
Process Xenority sended command VCommandsType.SLEEPING
Starting Player Process for Guild Xenority
[PROCESS PLAYER -> CONNECTING TO VOICE CHANNEL]
Player Process Xenority received command VCommandsType.PLAY
Player Process Xenority received command VCommandsType.RESUME
[ERROR IN PLAYHANDLER] -> Traceback (most recent call last):
File "/home/container/Handlers/PlayHandler.py", line 33, in run
musicsInfo = await self.__searcher.search(track)
File "/home/container/Music/Searcher.py", line 43, in search
raise error # Redirect already processed error
File "/home/container/Music/Searcher.py", line 38, in search
raise SpotifyError(self.__messages.SPOTIFY_NOT_FOUND,
Config.Exceptions.SpotifyError
{<class 'Config.Exceptions.SpotifyError'>}

[Enhancement] Add custom command

Can you make custom command for every command?
For example :
prefix (!)
play = p, pl
stop = s
history = h, hs
volume = vol
remove = rem, r, c, clear
etc...

And btw in python 3.12, there were a lot of errors.. so I had to downgrade to python 3.11..
I hope you update the code so it can run in latest version of python..
But for me it's not the main problem..

Googlevideo returning 403 forbiddenBug

Describe your context

BOT_PREFIX=v!
SHOULD_AUTO_DISCONNECT_WHEN_ALONE=False

The path to the bug
Try to play never gonna give you up

Screenshots

[https @ 0x557d7dae0200] HTTP error 403 Forbidden

https://rr7---sn-5uh5o-f5f6.googlevideo.com/videoplayback?expire=1697485403&ei=-z0tZbz6CrO-x_APjb2XmAE&ip=51.83.40.38&id=o-AEbgBGTv9CD9hgXqjKX4Qc_e6UJvadI3AjERSWi3nygg&itag=251&source=youtube&requiressl=yes&mh=7c&mm=31%2C29&mn=sn-5uh5o-f5f6%2Csn-4g5ednsl&ms=au%2Crdu&mv=m&mvi=7&pcm2cms=yes&pl=21&initcwndbps=187500&spc=UWF9f4yq_k4g4W8qqdxMb4j19QSAtPm0YZPTG_KqtA&vprv=1&svpuc=1&mime=audio%2Fwebm&gir=yes&clen=3437753&dur=212.061&lmt=1696366847061576&mt=1697463438&fvip=3&keepalive=yes&fexp=24007246&beids=24350018&c=ANDROID&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AGM4YrMwRgIhAJ_fZPZl5QFj_wfL6ZN4Q7s7JzgKYBaP2ZRFyu0FUoHkAiEAsHq5CQqKk70zLJECpktTxKcKPkxyqqg3Sa5HZ3D3QYQ%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AK1ks_kwRQIgBdfEygCFJ1piibxRsen5qY1TGoBpfUdPBjPv5ndjdxkCIQDnnBjXwl-LS72RAsyKQ2WVXiMRAVL-U7DiYQ3KSi8AcA%3D%3D: Server returned 403 Forbidden (access denied)

Music cog not loaded!!

[{'DiscordCogs.MusicCog': ExtensionFailed("Extension 'DiscordCogs.MusicCog' raised an error: TypeError: 'type' object is not subscriptable")}

No audio/sound after voice channel connection

Describe your context
Started seeing an issue yesterday where the bot would connect to a voice channel, but would not play any audio. To be certain it wasn't an isolated issue, I was able to recreate this issue on a completely clean brand new Debian installation with Python3.10.10. PIP seemed to install the necessary packages from the requirements.txt with no issues. The only changes made after cloning the repo were to update the .env file with the appropriate discord and spotify values. Aside from the .env file, no changes were made to any configs.
The path to the bug
Pretty simple, just issue a command such as !play the outfield your love lyrics. The bot does not react to the message to acknowledge the command was received successfully, but it does join the appropriate voice channel. However, no audio or sound is played and the bot will sit in the channel until the script is forcibly closed with ^c.

Screenshots
Here is the output from the python script:

$ python3.10 main.py
Starting Vulkan...
Vulkan is now operating.
Starting Player Thread for Guild MusicBotTest
[THREAD PLAYER -> CONNECTING TO VOICE CHANNEL]

I don't know that I've really included any helpful information, but if you can tell me where I can get any specific information you need I'll be more than happy to snag it and drop it here.

Bot fails to play certain Youtube videos

Describe your context:
Bot fails to play certain videos from Youtube. This seems to be related to copyright(?) preventing the bot from downloading the song contents. Similar to certain Youtube videos being blocked from common online Youtube to mp3/mp4 download sites. Bot works for other Youtube video links fine. I'm using a .env file for needed keys, configuration is unmodified except for the option to disconnect the bot after a certain amount of time from the voice channel when idle is enabled. Happy to provide other info.

The path to the bug:
After performing /play https://www.youtube.com/watch?v=cM1F9TbJhkk, the console outputs error:

WARNING: [youtube] Video unavailable. This video is not available
WARNING: No video formats found!
WARNING: Requested format is not available
DEVELOPER NOTE -> Failed to Extract URL https://www.youtube.com/watch?v=cM1F9TbJhkk
[ERROR IN PLAYHANDLER] -> Traceback (most recent call last):
  File "/home/container/Handlers/PlayHandler.py", line 35, in run
    raise InvalidInput(self.messages.INVALID_INPUT, self.messages.ERROR_TITLE)
Config.Exceptions.InvalidInput
 {<class 'Config.Exceptions.InvalidInput'>}

Screenshots:
image
image
image

ERROR IN PLAY SONG FUNCTION

When I try to play any track with the /play command, I get this error: [ERROR IN PLAY SONG FUNCTION] -> , <class 'discord.opus.Opus.OpusNotLoaded'>.
In discord only download message appears.

Help command error

This is first time I use bot, so sorry if I do something wrong

When I want to see all commands, it says :
image

When I check in terminal, it says :
image

Bug

I think the bot is now broken. It has been working very well with no issues but now if you try to play something the bot will join but no audio output im guessing its not getting audio now maybe youtube changed something. Regardless the core functionality works but the bot can no longer play any audio from youtube.

Error if shuffling and skip too fast

If the queue is shuffled and the music is skip faster than the first song is downloaded, there will be raised an error because the song doesn't have and source yet

No module named 'discord.bot'

After installing everything from the requirements.txt via pip install and running the main.py I get the following error:
image

Add Volume Feature

Can you add volume feature, that only owner or admin can set the volume?
Discord mobile sometime have bug, that you cant set the volume from bot, or even mute/unmute, so this feature will usefull I think...

Unable to extract uploader id error

So, when you try to download a video, the yt-dlp say: "ERROR: [youtube] GXFlILWExSY: Unable to extract uploader id; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U".
I think this caused by youtube new "@user" url. This was fixed in last versions of YoutubeDL, but when I try to start vulkan with last version of ytdl it crashes with many errors in console.

Bot won't start

Hello! I got this problem: https://pastebin.com/Gywr4pLK
Bot won't start, I'm using Python 3.10.06, installed every dependency, I'm on Ubuntu 22.04, I don't know how to set the .env file so I just replaced the tokens in the Config.py file and all tests seem to work.

ValueError: mutable default <class 'discord.utils._MissingSentinel'> for field name is not allowed: use default_factory

When trying to run Vulkan, following error message appears: ValueError: mutable default <class 'discord.utils._MissingSentinel'> for field name is not allowed: use default_factory.

Full log:

Traceback (most recent call last):
  File "/home/nikitaka/Documents/Vulkan-master/Vulkan-master/main.py", line 1, in <module>
    from Music.VulkanInitializer import VulkanInitializer
  File "/home/nikitaka/Documents/Vulkan-master/Vulkan-master/Music/VulkanInitializer.py", line 5, in <module>
    from Music.VulkanBot import VulkanBot
  File "/home/nikitaka/Documents/Vulkan-master/Vulkan-master/Music/VulkanBot.py", line 3, in <module>
    from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument
  File "/home/nikitaka/.local/lib/python3.11/site-packages/discord/ext/commands/__init__.py", line 18, in <module>
    from .flags import *
  File "/home/nikitaka/.local/lib/python3.11/site-packages/discord/ext/commands/flags.py", line 57, in <module>
    @dataclass
     ^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 1220, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 1210, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'discord.utils._MissingSentinel'> for field name is not allowed: use default_factory

I think it's not a problem with the bot itself, but with the discord.py package
P.S. I did pip install -r requirements.txt

Bug

Describe your context
I'm using default configuration with status changed and help name changed, keeping links to bot source.

The path to the bug
Whenever I play a song, I don't get any audio even though I made sure my py-cord is up to date and I'm only using spotify or youtube. I also reinstalled py-cord to be sure it wasn't a broken install.

Screenshots
Screenshots of the error thrown or the Bot messages will help us to fix you issue faster.
Screenshot 2023-08-12 181055
Screenshot 2023-08-12 181130

Bot does not like mobile Youtube links (m.youtube.com)

Describe your context:
Bot fails to play music when there is an 'm.' before the link, for example: /play https://m.youtube.com/watch?v=bIgVecA77Qo will cause the bot to fail. But if you remove the 'm.' (https://youtube.com/watch?v=bIgVecA77Qo) the bot will play the Youtube link just fine. I believe this is just a quality of life request, if a user inputs a m.youtube link, have the bot remove the 'm.' part?

The path to the bug:
After performing /play https://m.youtube.com/watch?v=bIgVecA77Qo, the console outputs error:

[ERROR IN PLAYHANDLER] -> Traceback (most recent call last):
  File "/home/container/Handlers/PlayHandler.py", line 33, in run
    musicsInfo = await self.__searcher.search(track)
  File "/home/container/Music/Searcher.py", line 21, in search
    raise InvalidInput(self.__messages.UNKNOWN_INPUT, self.__messages.UNKNOWN_INPUT_TITLE)
Config.Exceptions.InvalidInput
 {<class 'Config.Exceptions.InvalidInput'>}

Screenshots:
image
image
image

When I try to queue a Spotify playlist it doesn't work...

image

This is what happens ^^^

My python version:
3.11.5

My pip list:
Package Version


aiohttp 3.8.3
aiosignal 1.3.1
altgraph 0.17.3
annotated-types 0.6.0
ansicon 1.89.0
anyio 3.7.1
async-timeout 4.0.2
asyncio 3.4.3
attrs 22.2.0
autopep8 2.0.1
beautifulsoup4 4.12.2
blessed 1.20.0
Brotli 1.0.9
certifi 2022.12.7
cffi 1.15.1
charset-normalizer 2.1.1
chess 1.10.0
click 8.1.7
cloc 0.2.5
colorama 0.4.6
colored 2.2.3
dacite 1.8.1
deezer-python 5.3.3
Deprecated 1.2.14
discord.py 2.3.2
fastapi 0.103.2
ffmpeg-python 0.2.0
frozenlist 1.3.3
future 0.18.3
h11 0.14.0
httpcore 0.18.0
httpx 0.25.0
idna 3.4
imageio-ffmpeg 0.4.8
inquirer 3.1.4
iso8601 2.0.0
jaconv 0.3.4
jinxed 1.2.1
markdown-it-py 3.0.0
mdurl 0.1.2
multidict 6.0.4
mutagen 1.46.0
numpy 1.24.1
omdb 0.10.1
packaging 23.2
pefile 2023.2.7
Pillow 10.1.0
pip 23.3.1
platformdirs 3.11.0
psutil 5.9.6
py-cord 2.5.0
pycodestyle 2.10.0
pycparser 2.21
pycryptodomex 3.16.0
pydantic 2.6.3
pydantic_core 2.16.3
Pygments 2.17.2
pyinstaller 6.1.0
pyinstaller-hooks-contrib 2023.8
pykakasi 2.2.1
PyNaCl 1.5.0
python-chess 1.999
python-dateutil 2.9.0.post0
python-decouple 3.5
python-dotenv 1.0.1
python-editor 1.0.4
python-slugify 8.0.4
pytube 15.0.0
pywin32 306
pywin32-ctypes 0.2.2
PyWinBox 0.3
PyWinCtl 0.0.44
rapidfuzz 3.6.1
readchar 4.0.5
redis 5.0.0
requests 2.28.2
rich 13.7.1
setuptools 69.1.1
six 1.16.0
sniffio 1.3.0
soundcloud-v2 1.3.1
soupsieve 2.5
spotdl 4.2.4
spotipy 2.19.0
starlette 0.27.0
syncedlyrics 0.7.0
text-unidecode 1.3
tomli 2.0.1
ttkbootstrap 1.10.1
twitchio 2.8.1
typing_extensions 4.0.1
Unidecode 1.3.8
urllib3 1.26.14
uvicorn 0.23.2
wcwidth 0.2.12
websockets 10.4
wrapt 1.16.0
yarl 1.8.2
youtube-search-python 1.6.6
yt-dlp 2023.2.17
ytmusicapi 1.5.4

Bot goes to "sleeping" state immediately after starting playback

Describe the bug:
Upon invoking the play command, the bot initiates the playback process but immediately transitions to the "sleeping" state, preventing the song from playing.

To Reproduce:
Steps to reproduce the behavior:

  1. Start the bot.
  2. Invoke the play command for any song or audio source.
  3. Observe that the bot starts the playback process.
  4. Notice the bot immediately goes to the "sleeping" state.

Expected behavior:
The bot should play the song/audio source completely and then possibly transition to the "sleeping" state after the song is done or after a period of inactivity.

Logs:

Starting Vulkan...
Vulkan is now operating.
Starting Player Process for Guild [serverName]
[PROCESS PLAYER -> CONNECTING TO VOICE CHANNEL]
Player Process [serverName] received command VCommandsType.PLAY
Process [serverName] sended command VCommandsType.NOW_PLAYING
Process [serverName] sended command VCommandsType.SLEEPING

Environment:
OS: Windows 11
Python version: 3.11.4
Modules installed by pip:

Package             Version
------------------- ---------
aiohttp             3.8.3
aiosignal           1.3.1
asgiref             3.7.2
async-timeout       4.0.2
attrs               22.2.0
autopep8            2.0.1
Brotli              1.0.9
certifi             2022.12.7
cffi                1.15.1
charset-normalizer  2.1.1
deezer-python       5.3.3
Django              3.2.7
django-crispy-forms 2.0
djongo              1.3.6
dnspython           2.3.0
ffmpeg-python       0.2.0
frozenlist          1.3.3
future              0.18.3
idna                3.4
imageio-ffmpeg      0.4.8
multidict           6.0.4
mutagen             1.46.0
numpy               1.24.1
pip                 23.2.1
py-cord             2.4.1
pycodestyle         2.10.0
pycparser           2.21
pycryptodomex       3.16.0
pymongo             3.12.1
PyNaCl              1.5.0
python-decouple     3.5
pytz                2023.3
requests            2.28.2
setuptools          65.5.0
six                 1.16.0
spotipy             2.19.0
sqlparse            0.2.4
tomli               2.0.1
typing_extensions   4.0.1
urllib3             1.26.14
websockets          10.4
yarl                1.8.2
yt-dlp              2023.2.17

Bug queue

It seems that when the queue ends the bot crashes and doesn't work anymore at least it keeps downloading the music and it never ends with that it doesn't play the music

Error on playing the first song from Spotify

When running a spotify playlist, the preload function called at Music.py in line 80 and the other called in line 99 enter in conflict, resulting in youtube-dl not returning source and the song to be destroyed due to this error

[Enhancement]: Docker comtainerization

Hello, I am running the bot with docker and I tought that I could be useful for other to share my configuration. I am using a fork made by me, that allows all values in the config file to be set as environement variables, so that you don't need attach the cotainer to modify the file.

Dockerfile:

FROM python:3.10.0

ENV PYTHONUNBUFFERED=1

WORKDIR /app
RUN git clone https://github.com/Paillat-dev/Vulkan.git /app #cloning my fork to allow settings as env variables
RUN pip install -r requirements.txt
RUN apt-get update && apt-get install -y software-properties-common && apt-get install -y ffmpeg
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
CMD ["python", "main.py"]

docker-compose.yaml:

version: '3'
services:
  vulkan:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - BOT_PREFIX=v! #you can change the prefix
      - BOT_TOKEN=paste your bot token here!
      - SHOULD_AUTO_DISCONNECT_WHEN_ALONE=True #all settings can be set like this

simply put both files in a nw empty dir and run docker compose up -d or if it dosen't work add a dash between docker and compose.

Trouble when requesting many shards

Hello, to use the Vulkan music bot
When I tried to run it, I ran into a problem.

Looking around the code

bot = initializer.getBot()
in that line
I have confirmed that it creates a new instance.
This action is the process of creating a player process when playing a song on a new server.
A problem occurred in that part.

Bots that require a lot of shards take a long time to load in the beginning.
In the same way, it takes a lot of time to create instants, so songs cannot be played, and many servers are experiencing bottlenecks in creating instants when requesting song playback.

As a result, the song cannot be played.

Is there any way to solve that problem?
There are so many cool features that I really want to try!
Any help would be appreciated!

Bug ImportError: cannot import name 'SlashCommandOptionType' from 'discord.enums'

image

Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\Vulkan-master\main.py", line 1, in <module>
    from Music.VulkanInitializer import VulkanInitializer
  File "C:\Users\Administrator\Desktop\Vulkan-master\Music\VulkanInitializer.py", line 3, in <module>
    from discord.bot import Bot
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\bot.py", line 40, in <module>
    from .cog import CogMixin
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\cog.py", line 38, in <module>
    from .commands import (
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\__init__.py", line 27, in <module>
    from .core import *
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\commands\core.py", line 49, in <module>
    from ..enums import MessageType, SlashCommandOptionType, try_enum
ImportError: cannot import name 'SlashCommandOptionType' from 'discord.enums' (C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\enums.py)

Bot Not Working Anymore

Good day I tried your bot and initially it worked great its running on a raspberry pi 4 on Ubuntu the bot worked flawlessly until I got this error and it wont run anymore. Do you know the cause of the error I added the pastebin link with error below.

https://pastebin.com/qCRZfyGZ

This is my pip list

Package                Version
---------------------- -------------
aiofiles               23.1.0
aiohttp                3.8.3
aiosignal              1.3.1
anyio                  3.7.0
apturl                 0.5.2
async-timeout          4.0.2
attrs                  22.2.0
autopep8               2.0.1
bcrypt                 3.2.0
BingImageCreator       0.4.2
blinker                1.4
Brlapi                 0.8.3
Brotli                 1.0.9
certifi                2022.12.7
cffi                   1.15.1
chardet                4.0.0
charset-normalizer     2.1.1
click                  8.0.3
colorama               0.4.4
command-not-found      0.3
cryptography           3.4.8
cupshelpers            1.0
dbus-python            1.2.18
deezer-python          5.3.3
defer                  1.0.6
discord.py             2.3.0
distro                 1.7.0
distro-info            1.1build1
duplicity              0.8.21
EdgeGPT                0.8.1
exceptiongroup         1.1.1
fasteners              0.14.1
ffmpeg-python          0.2.0
frozenlist             1.3.3
future                 0.18.3
GoogleBard             1.2.2
h11                    0.14.0
httpcore               0.17.2
httplib2               0.20.2
httpx                  0.24.1
idna                   3.4
imageio-ffmpeg         0.4.8
importlib-metadata     4.6.4
jeepney                0.7.1
keyring                23.5.0
language-selector      0.1
launchpadlib           1.10.16
lazr.restfulclient     0.14.4
lazr.uri               1.0.6
lockfile               0.12.2
louis                  3.20.0
macaroonbakery         1.3.1
Mako                   1.1.3
markdown-it-py         2.2.0
MarkupSafe             2.0.1
mdurl                  0.1.2
monotonic              1.6
more-itertools         8.10.0
multidict              6.0.4
mutagen                1.46.0
netifaces              0.11.0
numpy                  1.24.1
oauthlib               3.2.0
olefile                0.46
PAM                    0.4.2
paramiko               2.9.3
pexpect                4.8.0
Pillow                 9.0.1
pip                    22.0.2
prompt-toolkit         3.0.38
protobuf               3.12.4
ptyprocess             0.7.0
py-cord                2.4.1
pycairo                1.20.1
pycodestyle            2.10.0
pycparser              2.21
pycryptodomex          3.16.0
pycups                 2.0.1
Pygments               2.15.1
PyGObject              3.42.1
PyICU                  2.8.1
PyJWT                  2.3.0
pymacaroons            0.13.0
PyNaCl                 1.5.0
pyparsing              2.4.7
pyRFC3339              1.1
python-apt             2.4.0+ubuntu1
python-dateutil        2.8.1
python-debian          0.1.43ubuntu1
python-decouple        3.5
python-dotenv          0.20.0
pytz                   2022.1
pyxdg                  0.27
PyYAML                 6.0
regex                  2023.6.3
reportlab              3.6.8
requests               2.28.2
rich                   13.4.1
SecretStorage          3.3.1
setuptools             59.6.0
six                    1.16.0
sniffio                1.3.0
socksio                1.0.0
spotipy                2.19.0
ssh-import-id          5.11
systemd-python         234
tomli                  2.0.1
typing_extensions      4.0.1
ubuntu-advantage-tools 8001
ubuntu-drivers-common  0.0.0
ufw                    0.36.1
unattended-upgrades    0.1
urllib3                1.26.14
wadllib                1.3.6
wcwidth                0.2.6
websockets             10.4
wheel                  0.37.1
xdg                    5
xkit                   0.0.0
yarl                   1.8.2
yt-dlp                 2023.2.17
zipp                   1.0.0
`

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.