Тёмный

How To Code a Discord Music Bot 

Max Codez
Подписаться 30 тыс.
Просмотров 230 тыс.
50% 1

TODAY we’re making a budget Rythm as easily as possible. Enjoy!
discord server: / discord
---------------
Thanks (for non copyright music):
---------------------------------------------
🍪 Soundcloud : / lukrembo​
⭐️ Twitter : / lukrembo​
😀 Instagram : / lukrembo​
✉️ Email : Lukrembo@gmail.com
---------------------------------------------
/ video-game-metal-tetrepic
---------------------------------------------
Thanks for watching!

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1,3 тыс.   
@maxcodez
@maxcodez 3 месяца назад
2024 edition: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sdgWRADImGk.html
@jowo8862
@jowo8862 3 года назад
I love so much how Max Codez includes the errors he made. This really shows how it is to be a real programmer instead of just "oh, here's my tutorial guys, I made it all perfect and I expect you to have no errors and do the same"
@_DRags
@_DRags 3 года назад
yes its great
@Y0oUrMama
@Y0oUrMama 2 года назад
i followed his tutorial to the teeth still got errors...
@jasper9062
@jasper9062 2 года назад
@@Y0oUrMama same
@jerrromeo4293
@jerrromeo4293 2 года назад
why dont you just marry him already 🙄
@Jaydee-nl3hi
@Jaydee-nl3hi 2 года назад
programmer always makes errors at the beginning
@eerieitroll4999
@eerieitroll4999 3 года назад
bro days of finding hour long tutorials and FINALLY a well explained one that is quick and easy!
@stepdadofacrab5008
@stepdadofacrab5008 3 года назад
Rythm just went down because of RU-vid’s cease and desist so ima use this to make a new bot for me and my friends. Thanks for the tutorial!
@ayushpramanik808
@ayushpramanik808 3 года назад
i am doing the same thing right now
@kamilusz2218
@kamilusz2218 3 года назад
Yeah me too
@KJCusKB
@KJCusKB 3 года назад
it doesnt work for me
@Dylandath
@Dylandath 3 года назад
Same
@lumi7610
@lumi7610 3 года назад
Does it work? Because I’m having problems
@WeebT
@WeebT 3 года назад
Using this for when all the music bots get taken down
@iosonomellioditu5898
@iosonomellioditu5898 3 года назад
Omg so honored to be in the video 🤩
@arianzahir5145
@arianzahir5145 3 года назад
can you help me with the code please?? I would love to copy it Getting too many errors
@manny8466
@manny8466 2 года назад
@@arianzahir5145 me too
@cloudybby1914
@cloudybby1914 2 года назад
@@arianzahir5145 same
@agnisen5796
@agnisen5796 3 года назад
Great tut for those starting out! Thanks! Also, I feel the join command may be a bit of an extra step considering it's specifically a music bot, so everyone will be using it to play music. We can simply use the join command in the play command to remove the extra step.
@joedean9724
@joedean9724 3 года назад
Can you make a part 2, where you show how to make a queue and loop music please!! And thanks for the video it was very helpful and easy to follow!!!
@_ianjms
@_ianjms 3 года назад
and a v2 bot that doesn't need an admin access
@Melsyndra
@Melsyndra 3 года назад
@@_ianjms i dont think it needs it i think they only added it because they were making a tutorial on it
@krish3047
@krish3047 3 года назад
Loved the intro and the vid is going to be awesome :-)
@supergubben
@supergubben 2 года назад
I tested it by playing never gonna give you up, never been so happy hearing that song
@hkrt_panaits
@hkrt_panaits 2 года назад
Yeah me too. Question how can i make the audio quallity better? it is really shitii.......
@Karlo_
@Karlo_ 3 года назад
This is fun to watch
@Karlo_
@Karlo_ 3 года назад
@@maxcodez I'm also trying to learn how to code discord bots so this is very helpful
@murilosardao9943
@murilosardao9943 2 года назад
for i in range(len(cogs)): cogs[i].setup(client) the program is going wrong at this part its saying that it has an attribute error, can anyone help me? pls
@francescoleggiero206
@francescoleggiero206 2 года назад
Make sure the setup function is not part of your music class, but outside it
@hyakki3914
@hyakki3914 2 года назад
@@francescoleggiero206 I am confused can you further explain how pls
@rekkekeke78
@rekkekeke78 3 года назад
Top new bots Rhythm is scared of
@djsmore8331
@djsmore8331 2 года назад
You deserved a massive audience dude
@piotrexxgamesandfilms8655
@piotrexxgamesandfilms8655 2 года назад
Please continue the music bot series and do tutorial for example about queues, skip command, loop commnand
@matheus-alexandre-souza
@matheus-alexandre-souza Год назад
discord.ext.commands.errors.CommandNotFound: Command "play" is not found
@AbandonedPath
@AbandonedPath 3 года назад
RIP Rythm / Groovy. :( Thanks for making this tutorial man!
@arianzahir5145
@arianzahir5145 3 года назад
Can you help me with the code please?? I would love to copy it Getting too many errors
@Saya0972
@Saya0972 2 года назад
@@arianzahir5145 me to :)
@SONICPLAYZROBLOX
@SONICPLAYZROBLOX 3 года назад
Rythm better be scared lol
@friendlyware2132
@friendlyware2132 3 года назад
true lol
@friendlyware2132
@friendlyware2132 3 года назад
Music Bot army incoming
@SONICPLAYZROBLOX
@SONICPLAYZROBLOX 3 года назад
@@friendlyware2132 lol yes
@qualitytrash
@qualitytrash 3 года назад
This didnt age well...
@dimssen
@dimssen 3 года назад
@@qualitytrash true
@DaBlincx
@DaBlincx 3 года назад
after a little change, the bot does come online but i cant use any commands, just nothing happens
@Oeggonom
@Oeggonom 2 года назад
Mine wont come online. Can you help me on this?
@coldentropy4354
@coldentropy4354 3 года назад
He made his previous video private. It was titled My Last Tutorial. I guess he won't be doing them anymore
@9k111
@9k111 3 года назад
Thanks dude! you're a life saver!
@yeefin2961
@yeefin2961 2 года назад
It says there is no such command in the consul every time I try to do !play !stop !resume ect
@anannmayasingh3182
@anannmayasingh3182 3 года назад
I am getting this error in def play() 'NoneType' object has no attribute 'stop'
@arbugoida
@arbugoida 3 года назад
same here
@mksfire7043
@mksfire7043 3 года назад
same
@Eternap
@Eternap 3 года назад
same
@fadeznetic
@fadeznetic 2 года назад
same, did you figure it out?
@TechnoLadz
@TechnoLadz 3 года назад
Just a return spot for myself: 4:25
@JosueR018
@JosueR018 3 года назад
Maybe next time making it work with Just the song tittle ?
@benyehudas8963
@benyehudas8963 3 года назад
Ya that would be nice
@nbow_ow
@nbow_ow 3 года назад
@@maxcodez yea that would be good
@JosueR018
@JosueR018 3 года назад
@@maxcodez yes plz
@HumbertofernandesHumberto748
@HumbertofernandesHumberto748 3 года назад
@@maxcodez make that
@wesleysilveira5692
@wesleysilveira5692 3 года назад
@@maxcodez plz, max, do a full version with queues and etc. that would be so nice :D
@graphicalgraphics6959
@graphicalgraphics6959 3 года назад
If you have issues with the pause and resume commands, use: @commands.command() async def pause(self, ctx): ctx.voice_client.pause() await ctx.send("Paused ⏸️") @commands.command() async def resume(self, ctx): ctx.voice_client.resume() await ctx.send("Resumed ▶️")
@barbyboi
@barbyboi 3 года назад
Hey, that may seem dumb, but do you have the whole code? If yes could you maybe post it cause i want to compare it with mine thanks:)
@reddwyd
@reddwyd 2 года назад
THANK YOU
@adityanverma5631
@adityanverma5631 2 года назад
Join command not working, any solution
@Ash197
@Ash197 2 года назад
@@adityanverma5631 same did you find the solution?
@DimitarQvorov
@DimitarQvorov 3 года назад
1:08 Because its green Me: *sees white*
@voloranic9920
@voloranic9920 2 года назад
can u help me with the 3rd line that says "import music"? it says that this line is an error
@tobiaslarsen2707
@tobiaslarsen2707 2 года назад
Same
@jokeryong800
@jokeryong800 3 года назад
This video is great...but can you make a tutorial of adding queue in it (means can add many song in queue even the current song isnt finished) and also loop...tysm!
@barbyboi
@barbyboi 3 года назад
Haha cogs!
@grayfox8547
@grayfox8547 2 года назад
3:40 the fun part
@Hyvexx
@Hyvexx 3 года назад
This is cool
@idontknowwhattoname7446
@idontknowwhattoname7446 2 года назад
uhh it didnt work for me idk why...
@histalkie
@histalkie 3 года назад
when i write import music in the main.py it not working it says that there is error in this line
@dkm1279
@dkm1279 3 года назад
I have the same problem. Have you found a way to fix it?
@jkm4505
@jkm4505 2 года назад
@@dkm1279 yoooo, found any fix?
@dkm1279
@dkm1279 2 года назад
@@jkm4505 sadly no
@jkm4505
@jkm4505 2 года назад
@@dkm1279 F turns out that my problem was a typo... Heh
@jivi8213
@jivi8213 2 года назад
For those who had trouble u need the code to actually log in the bot
@Oeggonom
@Oeggonom 2 года назад
How do you mean that? My Bot wont go online on itself :(
@spretzelz1256
@spretzelz1256 3 года назад
whos here after rythm got shut down
@mftemi
@mftemi 3 года назад
yup
@markinatorbozak4595
@markinatorbozak4595 7 месяцев назад
Yup
@suyashdongre
@suyashdongre 3 года назад
Finally
@Mai-sy9dn
@Mai-sy9dn 3 года назад
the download time for pynacl is gonna make me cry this takes so long
@JelowGames
@JelowGames 3 года назад
literally took me 2 seconds no exaggeration
@lordslushy1868
@lordslushy1868 3 года назад
@@JelowGames same-
@Cigaro_
@Cigaro_ 3 года назад
@@JelowGames yep, me too
@AveeVisualizer
@AveeVisualizer 7 месяцев назад
its not working anymore
@hyt69
@hyt69 3 года назад
B E A N S
@technicalsupportandvids4298
@technicalsupportandvids4298 2 года назад
Ffmpeg not found what should I do now?
@electrify3
@electrify3 2 года назад
Same here
@kompst_tu
@kompst_tu 3 года назад
When I have the bot join the channel, then try to play a RU-vid video, it will download the webpage, but then it says "Error in the pull function" so it doesn't pplay anything. I can join the bot to the vc, disconnect the bot from the vc, but it just doesn't play anything.
@vagac1
@vagac1 2 года назад
It wont join it says "discord.ext.commands.errors.CommandNotFound: Command "join" is not found"
@Blaze_27
@Blaze_27 2 года назад
same issue did u find any sol?
@SomePerson124
@SomePerson124 2 года назад
same
@Hecoal
@Hecoal 2 года назад
Check the indent
@waddlo261
@waddlo261 3 года назад
upload schedule go brrrrrrrrrrrrrrrrrr
@vitamin8821
@vitamin8821 3 года назад
when i try ?play theres a error says "[NULL @ 0x559e705a15c0] Unable to find a suitable output format for 'pipe:1' pipe:1: Invalid argument"
@beans8890
@beans8890 3 года назад
Same
@leofades_
@leofades_ 3 года назад
same
@dimasartavia6977
@dimasartavia6977 3 года назад
.
@aidanthetormentor9161
@aidanthetormentor9161 3 года назад
Me as well, any fixes yet?
@arcio.
@arcio. 2 года назад
.
@fasero
@fasero 2 года назад
Great Video! Thank you so much!
@iiBakedDonut
@iiBakedDonut 3 года назад
I have this as an error: cogs[i].setup(client) AttributeError: module 'music' has no attribute 'setup' Checked my spacing, spelling, both files, and I found nothing wrong. I even have the package downloaded. Not sure what to do here. Update - Fixed the problem, I had my setup linked inside of my Music class. The setup had to be on its own to work properly. I don't have anymore errors now.
@epicflails5471
@epicflails5471 3 года назад
same
@FrutiPebbels
@FrutiPebbels 3 года назад
What package did you download?
@iiBakedDonut
@iiBakedDonut 3 года назад
@@FrutiPebbels I downloaded the same package as the guy.
@wombit
@wombit 2 года назад
yeah uh how exactly did you fix this?????? like, without those fancy words like class and whatever, just an explanation of what you changed from the code shown in the video because i have no idea what im doing
@iiBakedDonut
@iiBakedDonut 2 года назад
​@@wombit As in the white lines on the left side, they were connected with the setup which should be at the very bottom of your music file. I deleted those lines until it was no longer connected with the rest of the bigger code above it, then spaced it out. I'm not sure if that's the same error you have but that's what I had.
@jorisneetens9774
@jorisneetens9774 Год назад
Hey for me it gives the error "discord.ext.commands.errors.CommandNotFound: Command "play" is not found" Does anyone know why this is?
@tonysparks6984
@tonysparks6984 2 года назад
i got the bot online but now it cant find the commands
@potterthings2927
@potterthings2927 2 года назад
my bot doesn't work, it says downloading webpage but it never play the audio, i am also not getting any errors. Can you help me
@gughanbabu6620
@gughanbabu6620 Год назад
have you fixed the issue , i got same issue now
@Bonnie39
@Bonnie39 3 года назад
How would you make a command to loop the current playing track though?
@sibzamani7538
@sibzamani7538 2 года назад
nice content bro very funy and good tutorial
@Affnaan
@Affnaan 3 года назад
hi Cactus
@dsfsfsgdffsadfgdfdgdfg8324
@dsfsfsgdffsadfgdfdgdfg8324 2 года назад
THANKS YOU FUCKING KILLED MY BOT
@snelle_tomos
@snelle_tomos 3 года назад
This video didn't age well :(
@harleenYT
@harleenYT 2 года назад
Did you have fun deleting comments? your video doesn't work, let people know.
@dembalo1946
@dembalo1946 2 года назад
did he really deleating comments?
@harleenYT
@harleenYT 2 года назад
@@dembalo1946 I have comented twice all the programming code in order to let people know the video is not useful and not to waste time, but he just deleted the comments.
@jedislayer861
@jedislayer861 2 года назад
@@dembalo1946 it works.
@quack6717
@quack6717 3 года назад
hippity hoppity ur code is mine
@quack6717
@quack6717 3 года назад
roses are red violets are blue idk how to respond to this and that makes me sad
@marijapivac1255
@marijapivac1255 2 года назад
BRO, YOU TOOK ME 1 HOUR
@rockwicha
@rockwicha 3 года назад
im getting the error cogs[i].setup(client) AttributeError: Module 'music' has no attrivute 'setup'
@theangypig3570
@theangypig3570 3 года назад
Same (sorry for useless commet)
@lavaboy2722
@lavaboy2722 3 года назад
same in vscode
@JustAPot
@JustAPot 3 года назад
make sure that it is 2 indents high
@NoNo-mb4sp
@NoNo-mb4sp 3 года назад
Did you figure it out?
@Renola01
@Renola01 3 года назад
@@JustAPot that's not worked :(
@pragatiailani7206
@pragatiailani7206 3 года назад
Why tf it is showing!? cogs[i].setup(client) AttributeError: module 'music' has no attribute 'setup' 😭😭
@matteo9471
@matteo9471 3 года назад
me too, have you fixed it?
@rechan0405
@rechan0405 3 года назад
put the cog name and class name same and then try
@DommiYT
@DommiYT 3 года назад
to fix module thing replace music with youtube-dl
@DhirajAndGaurav
@DhirajAndGaurav 5 месяцев назад
Tip:- if you make bot in replit. And it says FFmpeg not found then make some changes in replit.nix file where all dependencies are set Changes are in reply
@ThyBoiledOne
@ThyBoiledOne 3 года назад
OMG I ALSO GOT THAT CACTUE DOG 7 YEARS AGO
@dafaberlian
@dafaberlian 3 года назад
I just wondering. Would this also work for Spotify? Since I saw some of the official bots are able to play Spotify playlist
@evaa280
@evaa280 2 года назад
oh great!
@vitaas3141
@vitaas3141 3 года назад
Hi, could you please put out the code somewhere because I'm already doing it for the third time and it's still throws out errors out to me in advance thanks
@jxdzi
@jxdzi 3 года назад
yeah that would be nice
@thewaix4178
@thewaix4178 3 года назад
Yup l have the same problem even tho lm doing the exact same thing
@bjorn.m7282
@bjorn.m7282 3 года назад
@@thewaix4178 yea same
@toechampofficial
@toechampofficial 3 года назад
yea i cant stop fucking it up lol
@Hallowedkongyan
@Hallowedkongyan 2 года назад
Amazing and thank you :v
@itsronsss
@itsronsss 2 года назад
Hi I tried to write this previous one several times - , and I'm probably doing something wrong, can you please send the full code? i send u mail about it
@inventorsyndrome8894
@inventorsyndrome8894 Год назад
same issue here
@nixxinick
@nixxinick 3 года назад
4:17 theyre saying line 20 is wrong
@systemcame6541
@systemcame6541 3 года назад
that was helpful! but if you did it slower, it would be better from my prespective!
@WaterZerks
@WaterZerks Год назад
It says that commands aren't found when ran in discord... any fix?
@HelloWarudoTH6
@HelloWarudoTH6 2 года назад
Hey guys, everytime I try to use a command (join command for example), this message appears "Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "join" is not found". How to fix that?
@Mr.Samoloth
@Mr.Samoloth 2 года назад
dude please tell me how the fuck did you get ffmpeg to work on replit
@harelrasad1774
@harelrasad1774 2 года назад
i did exacly same as your code and every time im writing a command in discord it says in replit that cant find this command, ill like your help, thanks
@gho8t
@gho8t 2 года назад
Umm so it kinda didn't work....like there were errors after errors and i was tired fixing them...i started at 9:30PM at gave up at 12 AM... Guess im the only idiot here, Anyways great video...Really like it how you explain everything...you even let us see the errors and even fixed them for us....Appreciate it!
@KJCusKB
@KJCusKB 3 года назад
im haveing a problem saying AttributeError: 'tuple' object has no attribute 'add_cogs what should I do
@pink_milk_1795
@pink_milk_1795 3 года назад
so everything's working fine but its not recognizing any of my commands, if i use ?join, the console reads discord.ext.commands.errors.CommandNotFound: Command "join" is not found any idea whats going on?
@the_yashe
@the_yashe 3 года назад
Check tabs/spacing before each line
@pink_milk_1795
@pink_milk_1795 3 года назад
@@the_yashe the surprising thing is, before this one all my spacing was off which made for a whole gallon of errors. i fixed that tho and now this is the only error.
@pink_milk_1795
@pink_milk_1795 3 года назад
@@the_yashe im at work at the moment but once i get home ill copy over the "join" command section of the code, thanks.
@Tom-jn6dn
@Tom-jn6dn 3 года назад
Hey there i have the same issue with my code when anyone knows how to fix that pls write me!
@lkc7151
@lkc7151 3 года назад
@@pink_milk_1795 Hi, im also facing this error too, have u done solve the error?
@jaredcampbell8705
@jaredcampbell8705 2 года назад
Worked for me!
@JosueR018
@JosueR018 3 года назад
Can you show us to to make an advance ticket bot or mod mail bot
@chickenlittle8760
@chickenlittle8760 2 года назад
Can anyone help me the commands aren't working
@shriganeshprint
@shriganeshprint 3 года назад
Your video is awesome but there is an error when i try to play it from discord. It shows like this : Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "p" is not found
@chun_1310
@chun_1310 3 года назад
check if you set @client.command as @client.event by mistake or if you have declared the command named as 'p' at all.
@arianchoudhury4059
@arianchoudhury4059 3 года назад
Same problem with me
@franselo
@franselo 3 года назад
have you tried using ?play
@ipoststuff5658
@ipoststuff5658 3 года назад
Did you ever figure it out? I have the same issue
@737u
@737u 2 года назад
@@franselo whenever I run my code it gives me an error saying it doesnt recognize the command "?play"
@Vxhnz
@Vxhnz 2 года назад
my bot will not work i keep on getting a problem, it says that discord has no attribute FFmpeg0pusAudio. the bot joins the call but when i try get it to play it says this. any fixes?
@jedislayer861
@jedislayer861 2 года назад
It’s Opus, not 0pus
@hamzamalik225
@hamzamalik225 3 года назад
dude why don't you just provide the code to copy for us?
@atmoglaa
@atmoglaa 2 года назад
just look for his replit profile
@NitroXx
@NitroXx 3 года назад
Lmao this intro
@SharkieDrawss
@SharkieDrawss 3 года назад
bot didn't want to join voice channel, how to ffix it :(
@chairphobic
@chairphobic 2 года назад
my head hurts because of all the text XD
@enuma2270
@enuma2270 3 года назад
I'm getting "ClientException: ffmpeg was not found." When I try play, how do I fix this
@spadesltrash7203
@spadesltrash7203 3 года назад
are you using repl it or hosting it on your computer?
@Exalindor1
@Exalindor1 2 года назад
@@spadesltrash7203 on my computer
@turd_muncher8826
@turd_muncher8826 2 года назад
got this too.
@officalbananay
@officalbananay Год назад
can you make a new one thats based on spoitify not youtube because of youtubes new rule?
@panpukinart
@panpukinart 3 года назад
Hey there! Thank you so much for this video, it helped me out a ton. One thing though - it doesn't work for me yet. :,) This is the error message I'm recieving: Traceback (most recent call last): File "main.py", line 3, in import music I tried comparing the lines from my code and from the video, but they seem to be coinciding. import music Can't screw up all that much there. Does anyone know how to fix this? I made some errors when transferring the code, but here I'm kinda lost as there's no obvious errors I can see. Thank you!
@joesstickysock9384
@joesstickysock9384 3 года назад
did you download youtube-dl
@panpukinart
@panpukinart 3 года назад
@@joesstickysock9384 You know what? O didn't! I entirely missed that part, I feel really silly. Thank you so much, I'll fix that right away!! ❤
@Bhondamous
@Bhondamous 3 года назад
still isnt working
@rohangeorge257
@rohangeorge257 3 года назад
@@joesstickysock9384 i have downloaded youtube-dl and am still getting the same error as OP. Any other solutions?
@ricosannn4060
@ricosannn4060 3 года назад
@@rohangeorge257 did you fix it? i have the same problem
@zoranls
@zoranls 3 года назад
lack of code explanation bro..
@vikranth3924
@vikranth3924 3 года назад
how do u play music without the url btw love ur videos
@barbyboi
@barbyboi 3 года назад
Hell yes
@Nexpr0
@Nexpr0 3 года назад
im geting a line 3 error no modul named music
@mritunjay2624
@mritunjay2624 3 года назад
dude if you found any fix please update us too. thanks.
@TheInfallibleFallacy
@TheInfallibleFallacy Год назад
Alright folks let's fix this bad boy. Last weekend I needed this done for my server after MEE6 went down. I came here for help but as you can see from all the comments this code no longer works. I spent about 5 hours working through this video, discord py docs and stack overflow. I managed to scrape together a functioning bot. Super simple in a single file. It returns some errors on the pause and resume commands. It cannot queue songs, It does not leave after any amount of time, and ceases to function sporadically anywhere between 2-24 hours. It's not reliable. Now that may be because I've been running the thing in powershell the entire time but whatever. Since It's such a simple version of the bot that can't queue songs or leave the channel, I haven't bothered putting it on a legit server. In my mind why bother. I've been busy with work and haven't gotten the chance but if anyone wants to help with this or just run it yourself here you go. It's my third python project ever and my first discord bot so it's probably ass but I welcome feedback. import discord from discord.ext import commands import youtube_dl client = commands.Bot(command_prefix='!',intents=discord.Intents.all()) @client.event async def on_ready(): print(f"{client.user} has connected to discord!") @client.command() async def echo(ctx,*, message): await ctx.send(f"{message}") await ctx.message.delete() @client.command() async def play(ctx, url): if ctx.voice_client is None: await ctx.author.voice.channel.connect() else: ctx.voice_client.stop() FFMPEG_OPTIONS = { 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn' } YDL_OPTIONS = {'format': "bestaudio"} vc = ctx.voice_client with youtube_dl.RU-vidDL(YDL_OPTIONS) as ydl: info = ydl.extract_info(url, download=False) url2 = info['formats'][0]['url'] source = await discord.FFmpegOpusAudio.from_probe(url2, **FFMPEG_OPTIONS) vc.play(source) @client.command() async def pause(ctx): await ctx.voice_client.pause() await ctx.send("Paused") @client.command() async def resume(ctx): await ctx.voice_client.resume() await ctx.send("Resumed") client.run("TOKEN")
@TWJamesSS
@TWJamesSS Год назад
This is great I couldn't find a good music bot like this anywhere I'm currently trying to fix the play/pause issue and if I figure it out I'll be the first to tell you, but if you find the solution could you please tell me. Thanks and have a nice day!
@Codyno
@Codyno Год назад
@@TWJamesSS I hope you succeed
@Ninesstails
@Ninesstails Год назад
@@TWJamesSS discord doesn't support ctx, I suggest using nextcord and convert the command to slash and it might work better
@TWJamesSS
@TWJamesSS Год назад
@Codyno @vulpix500 I made it work!!!! @client.event async def on_ready(): print(f"{client.user} has connected to discord!") @client.command() async def echo(ctx,*, message): await ctx.send(f"{message}") await ctx.message.delete() @client.command() async def play(ctx, url): if ctx.voice_client is None: await ctx.author.voice.channel.connect() else: ctx.voice_client.stop() FFMPEG_OPTIONS = { 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn' } YDL_OPTIONS = {'format': "bestaudio"} vc = ctx.voice_client with youtube_dl.RU-vidDL(YDL_OPTIONS) as ydl: info = ydl.extract_info(url, download=False) url2 = info['formats'][0]['url'] source = await discord.FFmpegOpusAudio.from_probe(url2, **FFMPEG_OPTIONS) vc.play(source) @client.command(brief="Pauses the currently playing song.") async def pause(ctx): try: ctx.voice_client.pause() except: await ctx.send(f"{ctx.author.mention} i'm not playing music at the moment!") @client.command(brief="Resumes the paused song.") async def resume(ctx): try: ctx.voice_client.resume() except: await ctx.send(f"{ctx.author.mention} i'm not playing music at the moment!") @client.command() async def leave(ctx): await ctx.voice_client.disconnect()
@TWJamesSS
@TWJamesSS Год назад
@@Ninesstails I made it work check comments!!!!!!!!!!!!!!!
@RitvikivtiR
@RitvikivtiR 3 года назад
Hi, I've done everything I had to. However, whenever the bot joins, it has the green circle around it and whenever I use the play command along with the link " play " it doesn't do anything. Can you help with this?
@Painlover34
@Painlover34 3 года назад
Make sure you're running the program and then try inputting the command
@RitvikivtiR
@RitvikivtiR 3 года назад
@@Painlover34 yeah I did everything, the green circle around the bot appears but still no sound
@Painlover34
@Painlover34 3 года назад
@@RitvikivtiR hmm, did you enable the intents for the bot? In the discord development portal, go to your bot, under "Priveleged Gateway Intents" there should be 2 options you can enable (presence intent, and server member intent) are both enabled?
@ugurgorkem
@ugurgorkem 3 года назад
@@RitvikivtiR did you solve this problem?
@ugurgorkem
@ugurgorkem 3 года назад
@@Painlover34 hi jason i have same error and i did what you say do you have another solution??
@OnkarSagare1
@OnkarSagare1 2 года назад
im getting client.add_cog(music(client)) atributeerror bot object has no atribute add_cog how can i fix it
@samchristopher6906
@samchristopher6906 2 года назад
add_cogs*
@user-bv6qt1gx4f
@user-bv6qt1gx4f 3 года назад
how to fix this??: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'stop'
@BrenoMathFUR
@BrenoMathFUR 3 года назад
Same problem here, if you fix it, tell me pls
@dimasartavia6977
@dimasartavia6977 3 года назад
.
@andrey5056
@andrey5056 3 года назад
Remember to use the command "join" XD
@DAX_PL
@DAX_PL 3 года назад
.
@GEOGUY-iv5qr
@GEOGUY-iv5qr 3 года назад
Same problem here
@tzabaothlbys4971
@tzabaothlbys4971 3 года назад
THANK YOUUU SO MUCH
@DZTheGamer
@DZTheGamer 3 года назад
Can you help with this? TypeError: 'float' object cannot be interpreted as an integer. This error popped up in terminal in line 3 with 'import music'
@mritunjay2624
@mritunjay2624 3 года назад
dude if you find this fix please update us
@vino24995
@vino24995 2 года назад
any updates on this?
@DZTheGamer
@DZTheGamer 2 года назад
@@vino24995 Yes and no. Yes that I got past the problem but no because it only created another problem within the code "/
@krzysztofolech3276
@krzysztofolech3276 2 года назад
Im running the bot and the whole code is perfect including the bot token and yet the bot isnt coming online, anyone know why?
@Latinb0y22
@Latinb0y22 2 года назад
I'm having the same issue and idk what I'm doing wrong
@raiders2007
@raiders2007 3 года назад
instead of typing out pause and stuff is there a way to make it pause stop clear remove when you react to it? or is that more complicated?
Далее
C++ Developer Learns Python
9:26
Просмотров 2,7 млн
СМЕЛОЕ РЕШЕНИЕ #shorts
00:14
Просмотров 22 тыс.
GIANT Gummy Worm Pt.6 #shorts
00:46
Просмотров 8 млн
Create a Music Discord bot using Python
16:46
Просмотров 116 тыс.
Playing Minecraft with ChatGPT | Mindcraft
18:34
Просмотров 154 тыс.
How to win a argument
9:28
Просмотров 547 тыс.
Why Scientists Are Puzzled By This Virus
11:47
Просмотров 1,8 млн
You Might Lose your Active Developer Badge!
10:49
Просмотров 527 тыс.
🚀 Create a Chat GPT Bot in Discord (with GPT-4)
21:05
СМЕЛОЕ РЕШЕНИЕ #shorts
00:14
Просмотров 22 тыс.