Create a Music Discord bot using Python

preview_player
Показать описание
Create a music bot using python, discord py, ffmpeg and youtube_dl. I will guide you through the entire process from the setup stage to actually running the bot on a channel.
Please note that it is now illegal to use discord music bots that rely on youtube, so this video should only be used for learning and personal use.

You need python 3.4 or above to run a discord bot.

My stuff ( these are affiliated )

I will make a video on how to run this program without any knowledge about coding soon and how you can make it scale infinately. I've included me debugging the code to also show you what that looks like.
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

Chapters:
0:00 demo
0:17 dependencies
1:40 discord dev console
2:54 entry point
4:12 music bot
5:21 search
5:52 play next
6:39 play music
7:50 play command
9:35 pause command
9:56 resume command
10:14 skip command
10:36 queue command
11:10 clear command
11:37 leave command
11:50 helper_cog
12:31 on ready
13:10 sent to all
13:30 help command
13:55 debugging
15:57 common issues
16:22 github and docker

#discord #bot #music
Рекомендации по теме
Комментарии
Автор

Let me know what other features you'd like to see or if you encounter any problems 😉

Computeshorts
Автор

if anyone is still working with this tutorial:
at first: youtube_dl has been discontinued so your next best choice is yt_dlp which is a "newer" version of yt_dl.
additionally: in the 'search_yt' function - in the return statement - remove the following: "['formats'][0]" - leaving only "return{'source': info['url'], ...}"
this is caused by a change in the JSON data by yt_dlp.
hope this helps.

ye
Автор

Amazing.
Your channel is really underrated, though I would understand that it might be hard for beginners to understand most of the code as you don't really explain it. But making a discord bot is also not a very beginner friendly thing so there's that.

JustinS
Автор

Thank you my friend, you saved me a lot, save from Brazil!!

pandinijoao
Автор

the cogs have a new update.. can u make tutorial video for setup the cogs ?

azharindrawan
Автор

I really enjoy your channel and you are a good teacher. I might have missed sotNice tutorialng and I don't get friends with the setuper. I worked

erfanakhavan
Автор

Oh and FIY, pulling music from YouTube is actually illegal, but I wouldn't worry about it if it's just a personal bot or if it's in a small server.

JustinS
Автор

None of the commands are getting picked up :( Can someone help?

dovydasdovydas
Автор

the bot is entering the channel however there is no sound playing what to do ? in the terminal there r no errors and it's downloading the info I copied your source code too

Mxdy_
Автор

Hi guys. I have a problem. I have made everythink identical to the video my bot even starts, but the problem is that he doesn`t response me when i am trying to use any of command, idk why

zhka_
Автор

I copied everything word to word but for some reason my bot just doesnt play audio. Can anyone help me with this please.

ESIMapping
Автор

Cannot import name 'help_cog' from 'help_cog' error. Plz help

oekrjos
Автор

Hello, I got everything to work except no audio will play when the bot is connected in VC. It successfully finds the video's URL and they are skippable, can be queued, and all songs queued show up in the list. I used some comments here to work around the changes to youtube_dl and also implemented the new Cog update, as well as referencing your github. I think it may be an issue with ffmpeg but I cant seem to sort it out. Any help would be appreciated.

spikeydavid
Автор

Bro, could you help me? Every time I write the command to play this error appears:
Ignoring exception in command None:
Command "play" is not found. The only command that works is help, I've tried to change some things but it didn't help

MarcioSantos-infq
Автор

can't open file '*insert directory here': [Errno 2] No such file or directory please help

jacefactory
Автор

I did everything correct, no error, the bot joins, the commands work, but i don't hear any sound when he says he is playing

😔

EasyKey
Автор

hello
ImportError: cannot import name 'help' from 'help'
please help me

fantais
Автор

I can't use any command like /p (music link) but don't have anything happen in terminal and discord how can i fix this i have no error

minsu-vn
Автор

This code doesn't work anymore for anyone who is still working on this project.

slavic_fox
Автор

Traceback (most recent call last):
File "C:\Users\Dylan\Desktop\YouBot\YouBot\main.py", line 7, in <module>
from music_cog import music_cog
File "C:\Users\Dylan\Desktop\YouBot\YouBot\music_cog.py", line 95
self.is_playing = False
TabError: inconsistent use of tabs and spaces in indentation

zkasxplr