Too late to reply.. But greatt tutorial everything worked smoothly as per the need.. Future potential tutorial idea: searching for URL if name of the video is provided.
#repeat @client.command(name = "repeat") async def repeat(ctx): global repeat_songs global current_song repeat_songs = abs(repeat_songs-1) if repeat_songs == 1: await queue(ctx,current_song) await ctx.send("repeated now") else: await ctx.send("don't repeated now") idk how to avoid in python keyword "global" for global vars in this context, but it works.var current_song is the current played song.In the play_next popping url adding to queue again and so on Also repeat_songs must be boolean type this my mistake/
Hi, there's a problem. I did everything as shown in the video, but at startup it gives the following error Traceback (most recent call last): File "c:\ds_bot\main.py", line 4, in bot.run_bot() File "c:\ds_bot\bot.py", line 107, in run_bot client.run(TOKEN) File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 860, in run asyncio.run(runner()) File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\asyncio unners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 849, in runner await self.start(token, reconnect=reconnect) File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 777, in start await self.login(token) File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 609, in login raise TypeError(f'expected token to be a str, received {token.__class__.__name__} instead') TypeError: expected token to be a str, received NoneType instead Could you help me figure this out?
@@ethancox2025 Hooray, I figured it out. I had problems with VS and support for .env files. I tried to run it on PyCharm and everything worked. Many thanks to you for the guide))))
@@ethancox2025 I have been tryna use replit to host the bot 24/7 in the cloud, I got it connect and log into the discord server but when i .play a yt video I keep getting ffmpeg not found and I’ve triple checked that I have ffmpeg.exe’s path correctly in env variables idrk other than it’s something with replit maybe
@@ethancox2025 couldn’t get it to work the bike connects to my discord server, but when I try to play a song, it says FFMPeg not found I’ve copied the correct path in env varibles like 4 times. I’m using replit to try and host in cloud 24/7 but can’t figure it out.
It doesn't play for me. I get this error: ffmpeg was not found... [youtube] Extracting URL: th-cam.com/video/tzfVd_xq80k/w-d-xo.html [youtube] tzfVd_xq80k: Downloading webpage [youtube] tzfVd_xq80k: Downloading ios player API JSON [youtube] tzfVd_xq80k: Downloading m3u8 information ffmpeg was not found. What could be wrong?
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/discord/player.py", line 29, in import audioop ModuleNotFoundError: No module named 'audioop' audioop is now depreciated, so what should I do to fix this instead?
Hy there Ethan thanks for this informing video i'm having trouble on this and i try adding it as a cog rather than a async function it still runs but it's giving me the error of ffmpeg not found even i did add it to my enviroments variables : Already connected to a voice channel. [youtube] Extracting URL: th-cam.com/video/n78m4NjhqGg/w-d-xo.html&ab_channel=Ethan%7CTheCodeSyndicate [youtube] tS8nzAQg_8k: Downloading webpage [youtube] tS8nzAQg_8k: Downloading ios player API JSON [youtube] tS8nzAQg_8k: Downloading android player API JSON [youtube] tS8nzAQg_8k: Downloading m3u8 information ffmpeg was not found.
@@programmer2625Try putting the address where the ffmpeg.exe is located, for example, in the PATH, delete the previous one and put like this: C:\ffmpeg\bin remember that this will depend on where you have extracted the ffmpeg folder
Hi, thank you for these tutorials! I'm having an issue with the queue, the bot plays the first song without a problem, but once anyone adds another song when one is already playing, I get this error: Already playing audio. discord.player ffmpeg process 7860 has not terminated. Waiting to terminate... discord.player ffmpeg process 7860 should have terminated with a return code of 1.
Thanks for making this video, bots working perfectly!
@m.h630 thanks for the kind words! Glad it's working so many months later.
very useful,thanks for the perfect tutorial.
Thanks my dude!
what should i do if the terminal shows "INFO discord.client logging in using static token" and the bot still doesn't appear online ?😞
Too late to reply.. But greatt tutorial everything worked smoothly as per the need..
Future potential tutorial idea: searching for URL if name of the video is provided.
just typing the command and listening to music with the bot
does this support playing playlists?
great video btw
I actually have never tried that. Did it work for you?
@@ethancox2025 no it didnt, it seems to connect to voice channel and download all the songs in the list but doesnt play anything
Excellent video, is there a way to use command “play” for both play and queue functions?
#repeat
@client.command(name = "repeat")
async def repeat(ctx):
global repeat_songs
global current_song
repeat_songs = abs(repeat_songs-1)
if repeat_songs == 1:
await queue(ctx,current_song)
await ctx.send("repeated now")
else:
await ctx.send("don't repeated now")
idk how to avoid in python keyword "global" for global vars in this context, but it works.var current_song is the current played song.In the play_next popping url adding to queue again and so on
Also repeat_songs must be boolean type this my mistake/
could you tell me in detail how you did this command?
Hi, there's a problem. I did everything as shown in the video, but at startup it gives the following error
Traceback (most recent call last):
File "c:\ds_bot\main.py", line 4, in
bot.run_bot()
File "c:\ds_bot\bot.py", line 107, in run_bot
client.run(TOKEN)
File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 860, in run
asyncio.run(runner())
File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\asyncio
unners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 849, in runner
await self.start(token, reconnect=reconnect)
File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 777, in start
await self.login(token)
File "C:\Users\OLEG\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 609, in login
raise TypeError(f'expected token to be a str, received {token.__class__.__name__} instead')
TypeError: expected token to be a str, received NoneType instead
Could you help me figure this out?
Looks like the token was never set. Did you set it in the .env file and specifically reference it as your TOKEN var with load_env?
@@ethancox2025 well, I just installed all the libraries, put my bot's token in .env and ran the code. Do I need to change something else?
@@ethancox2025 Hooray, I figured it out. I had problems with VS and support for .env files. I tried to run it on PyCharm and everything worked. Many thanks to you for the guide))))
So glad you figured it out! VS Code can be finicky with .env lol
Hallo, my name is Karinas. i get all time error (ffmpeg not found) can you pliz help meni. Tenks!
Can someone explain to me why when I add a track to the queue, the playing music starts to freeze?
This could be low network connectivity
@@ethancox2025 This happens exactly at the moment a new track is added to the queue. I tried everything, but nothing changes...😥
@@dehavo Were you able to fix it?, I also have this problem, but it cuts out after a minute when the current song is playing.
Thank you! queue for this case is really not so obvious as i thinked.If we want to repeat our queue for playing maybe realise linkedlist?
Glad you liked it!
Gonna try an make this tomorrow
Sweet! How'd it go?
@@ethancox2025 I have been tryna use replit to host the bot 24/7 in the cloud, I got it connect and log into the discord server but when i .play a yt video I keep getting ffmpeg not found and I’ve triple checked that I have ffmpeg.exe’s path correctly in env variables idrk other than it’s something with replit maybe
@@ethancox2025 couldn’t get it to work the bike connects to my discord server, but when I try to play a song, it says FFMPeg not found I’ve copied the correct path in env varibles like 4 times. I’m using replit to try and host in cloud 24/7 but can’t figure it out.
@@m0str33t does it work locally? You'll need to set the environment variables in Replit if you're hosting there
You can add a feature that will repeat a whole series of songs pls🙏
ty 🖤
It doesn't play for me. I get this error: ffmpeg was not found...
[youtube] Extracting URL: th-cam.com/video/tzfVd_xq80k/w-d-xo.html
[youtube] tzfVd_xq80k: Downloading webpage
[youtube] tzfVd_xq80k: Downloading ios player API JSON
[youtube] tzfVd_xq80k: Downloading m3u8 information
ffmpeg was not found.
What could be wrong?
Thank for vid. What about video how upload bot on hosting service? It will help a lot
Future video 👀
will you follow me all ready and put them on and listen to music with the bot
Still working?
git pull?
Check description
@@ethancox2025 thanks :D
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/discord/player.py", line 29, in
import audioop
ModuleNotFoundError: No module named 'audioop'
audioop is now depreciated, so what should I do to fix this instead?
sorry if this is late but pip install audioop -its
amazing
Hello 👋🏿 i need help
@@IN3ANEEDITZ hello!
Hy there Ethan thanks for this informing video i'm having trouble on this and i try adding it as a cog rather than a async function it still runs but it's giving me the error of ffmpeg not found even i did add it to my enviroments variables :
Already connected to a voice channel.
[youtube] Extracting URL: th-cam.com/video/n78m4NjhqGg/w-d-xo.html&ab_channel=Ethan%7CTheCodeSyndicate
[youtube] tS8nzAQg_8k: Downloading webpage
[youtube] tS8nzAQg_8k: Downloading ios player API JSON
[youtube] tS8nzAQg_8k: Downloading android player API JSON
[youtube] tS8nzAQg_8k: Downloading m3u8 information
ffmpeg was not found.
You might need to restart your computer after making it an environment variable. I know that fixed this for me
@@ethancox2025 it didn't work even tho it gave me the same error
@@programmer2625Try putting the address where the ffmpeg.exe is located, for example, in the PATH, delete the previous one and put like this: C:\ffmpeg\bin remember that this will depend on where you have extracted the ffmpeg folder
ty Ethan
Hi, thank you for these tutorials!
I'm having an issue with the queue, the bot plays the first song without a problem, but once anyone adds another song when one is already playing, I get this error:
Already playing audio.
discord.player ffmpeg process 7860 has not terminated. Waiting to terminate...
discord.player ffmpeg process 7860 should have terminated with a return code of 1.
I have the same issue. Do u solve it?
@@qaguthur_tu3366 Not yet, I've been stumped for weeks now