Тёмный

Create Your Own Discord Bot in Python 3.10 Tutorial (2022 Edition) 

Indently
Подписаться 211 тыс.
Просмотров 353 тыс.
50% 1

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

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 544   
@Indently
@Indently 2 года назад
I've noticed that they had a recent update in Discord. If your code is missing intents, try creating some: intents = discord.Intents.default() intents.message_content = True client = discord.Client(intents=intents) Also remember to go on the developer website and under the "BOT" section you can toggle a new "MESSAGE CONTENT INTENT" switch. For the 2024 version + source code: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UYJDKSah-Ww.html
@sugarrush708
@sugarrush708 2 года назад
@@ronrishadi Did you learn where to put it? I seem to be having the same issue as you.
@avinashtotlani6703
@avinashtotlani6703 2 года назад
it works thanks thanks alot for this mate
@hans4595
@hans4595 2 года назад
Does anyone know whye ven after putting the intents, message.content is still empty for me?
@luxe4295
@luxe4295 2 года назад
i need help it says "AttributeError: module 'bot' has no attribute 'run_discord_bot' " what do I do I really need that bot help me plzz
@zoo-logic1496
@zoo-logic1496 2 года назад
​@@ronrishadi
@diegobonaventura8501
@diegobonaventura8501 Год назад
client = discord.Client(intents=discord.Intents.default()) I had to add this to the program to get it to work
@____________________________x
Yeop I had pain with that
@pewpau
@pewpau Год назад
Can be the bot multipurpose, moddings, emebeds, autoresponders and etc but not super multipurpose just the basic multipurpose
@____________________________x
@unknownmovies4351 right after import discord
@yeetyeetyeet1967
@yeetyeetyeet1967 Год назад
@unknownmovies4351at 8:51, replace his client variable with the new one
@LewisStockton
@LewisStockton Год назад
Life saver! I could kiss you
@orlandodgpim
@orlandodgpim Год назад
I might be able to create a custom bot that i need for a client thanks to this video. Making bots is not my area of work, but this video has helped a lot. Thank you
@ishaannaolekar3126
@ishaannaolekar3126 Год назад
amazing video bro thanks for the help got my bot running just had to do the intents change in the code and the bot as well thanks to everyone else as well who pointed it out in the chat
@Danimx02
@Danimx02 Год назад
i have the same problem. What did you do to solve it
@Tak_Tak3Phobia
@Tak_Tak3Phobia 11 месяцев назад
For people who need the tick, here ---> ` :)
@Haz3zy
@Haz3zy 9 месяцев назад
So happy that I took 2hrs to make and fix and watched 16 extra tuts and still did not work, thanks alot!
@fracops3742
@fracops3742 7 месяцев назад
same
@Lkdytz
@Lkdytz 5 месяцев назад
Same
@Luchsevans
@Luchsevans Год назад
Thanks a lot. Your video was very good to follow along while coding.
@e2k220
@e2k220 Год назад
simple and easy to understand thanks for the basics
@Jamaipanese
@Jamaipanese Год назад
AMAZING! Clear, informative and python noob friendly! Going to use this as a base to make a bot now! THANK YOU!
@lightestx
@lightestx Год назад
lol
@n4kyra
@n4kyra Год назад
uhm.. how to open python tho
@fahnub
@fahnub Год назад
Thanks for this. Helped me with my project.
@luxe4295
@luxe4295 2 года назад
I need help I cant run it it says "AttributeError: module 'bot' has no attribute 'run_discord_bot' " what do I do I really need that bot help me plzz
@lauraa1358
@lauraa1358 2 года назад
i got the same problem
@Parven05
@Parven05 2 года назад
Thanks man ! Today I learn the basics to make a discord bot with python
@Moonisscoobis
@Moonisscoobis 11 месяцев назад
i dont get this at all????
@matsandthecats54
@matsandthecats54 2 года назад
when i run my program i get no errors but it doest go online and its not printing anything anyone know why?
@littelbirdman3709
@littelbirdman3709 Год назад
Begin printing messages places you might think is where the code isnt working then change things there and look for mistakes. Its probaly something with the bot not activating at all so look in main and bot
@LeafyUp
@LeafyUp Год назад
italian here surprised u talk english so fluently
@sezack950
@sezack950 Год назад
hi thanks for youre codes but i have a problem with running the bot Exception has occurred: AttributeError module 'discord' has no attribute 'Client' what shoud i do?
@ME-kl9bj
@ME-kl9bj Год назад
where it says client = discord.Client() put client = discord.Client(intents=discord.Intents.default())
@RobinToshFr
@RobinToshFr Год назад
@@ME-kl9bj THANKS !!!!
@Zizians
@Zizians 2 года назад
Why the bot does not respond to any of the messages
@Galing28
@Galing28 Год назад
Same
@lolman6976
@lolman6976 Год назад
@Copper_17 your on the wrong version or you messed up the code
@SietseGaming
@SietseGaming Год назад
if you message the bot in a private chat it will work i dont know why it does not work in servers
@joao_c
@joao_c Год назад
​​@@SietseGaming try using: client = discord.Client(intents=intents.all()) It worked for me
@azes8849
@azes8849 Год назад
​@@SietseGaming you have to change .default to .all
@TechnicalFunds
@TechnicalFunds Год назад
can u please make a Roblox claimable group finder Python bot for me plz?
@skvnkzzvods
@skvnkzzvods Год назад
ive just done this but it continues to reply with: Traceback (most recent call last): File "C:\Users\Windows PC\PycharmProjects\pythonProject\main.py", line 1, in import bot File "C:\Users\Windows PC\PycharmProjects\pythonProject\bot.py", line 1, in import discord ModuleNotFoundError: No module named 'discord' what do i do??
@crispy.caesus
@crispy.caesus Год назад
thx good video love the use of try except and several files
@yughin
@yughin Год назад
If it's not working try client = discord.Client(intents=discord.Intents.default())
@karenmarin7681
@karenmarin7681 Год назад
omg u are a hero. TYSM
@ari_theflower
@ari_theflower Год назад
needed to put client = discord.Client(intents=discord.Intents.default()) for line 15 for bot to run :p if anyone has any cool or semi-cool resources or communities for python, plz lemme know
@bethanygeorge8116
@bethanygeorge8116 Год назад
Thank you!! I got stuck on this same part
@swaggychips
@swaggychips 10 месяцев назад
thank you bro ur a life saver
@marcellaudenberg4365
@marcellaudenberg4365 2 года назад
Love your vids helping me so much ❤️
@totallyastranger1451
@totallyastranger1451 Год назад
I might have ran into trouble, however, after copying the source code and importing my own token the bot still did not work.
@FlediX2
@FlediX2 Год назад
Was this your error? Client.__init__() missing 1 required keyword-only argument: 'intents' If it was, I found that writing discord.Client(intents=discord.Intents.default()) instead of just discord.Client() fixed my problem.
@crowant3717
@crowant3717 Год назад
@@FlediX2 thank you SO much this fixed my issues
@Bammyy
@Bammyy Год назад
@@FlediX2 LIFESAVER
@My_Channel12342
@My_Channel12342 Год назад
I am having a problem it says: 400 Bad Request (error code: 50006): Cannot send an empty message. how to fix that?
@karenmarin7681
@karenmarin7681 Год назад
omg I have a same problem :(
@wholegz1103
@wholegz1103 Год назад
Hi guys just to say the "backwards tick" is achieved by hitting the tilde key on your keyboard which is just bellow escape. :)
@jas2890
@jas2890 Год назад
Only really works in countries that have dollar signs as their currency like Canada or Australia most other places have their other symbol on the number row i.e. £, ¥, or € in which case the hash symbol is moved under the backspace, I believe this person is Scandinavian so he would have a hash where you are describing. The place the "backtick" is moved to everywhere else is to the left of the 1 key along with the "broken bar" and "not sign".
@JonathanSoriano-bv6zi
@JonathanSoriano-bv6zi 9 месяцев назад
Hello Just wanna ask if what software did you use for this? Is it Visual Studio? If not, can i do it in visual studio?
@Anonymous-ho4do
@Anonymous-ho4do 2 года назад
after I run the pip install discord is still get these message: Traceback (most recent call last): File "C:\Users\Siyu Miao\PycharmProjects\hangoutbot\main.py", line 1, in import bot File "C:\Users\Siyu Miao\PycharmProjects\hangoutbot\venv\bot.py", line 1, in import discord ModuleNotFoundError: No module named 'discord' Process finished with exit code 1
@n0kkk
@n0kkk Год назад
bruh the best italian english speaker that I ever seen
@syxlv
@syxlv 8 месяцев назад
does anyone know how to fix the issue where the bot is only reading incoming messages as ' '
@franksegenhirn
@franksegenhirn 8 месяцев назад
If you want to, you can send me your code, so I can help you fix the issue
@pilotgfx
@pilotgfx Год назад
its not working , bot just sends empty messages, and cannot fetch the message of the user, only the user name. i suggest try another tutorial
@pilotgfx
@pilotgfx Год назад
i made a minimal version with almost the same functionality that should work if anyone is struggling. just one py file. (message.content not loading properly for some reason when following the tutorial): import discord import random client = discord.Client(intents=discord.Intents.all()) @client.event async def on_message(message): if message.content.lower() == 'hello': await message.channel.send("hi") if message.content.lower() == 'roll': await message.channel.send(str(random.randint(1,6))) client.run("put-your-key-here")
@neiro314
@neiro314 9 месяцев назад
check my newest comment to fix this
@jackyin953
@jackyin953 Год назад
Thank you so much! Super helpful video
@Moki314
@Moki314 Год назад
If you run into any weird problems, make sure you have response / responses correct in the send_message - speaking from experience
@prismstealthx100
@prismstealthx100 Год назад
thanks, my spelling was wrong in that line , but it still doesn't work :')
@Moki314
@Moki314 Год назад
@@prismstealthx100 I spent a few hours debugging my code before I got it to work, I even used Chat GPT to help find mistakes which isn't perfect by any means, but still helpful - Keep working at it, you'll get it to work eventually!
@prismstealthx100
@prismstealthx100 Год назад
@@Moki314 yep, i am going to try again tomorrow, if still doesn't work, then i will see another video
@DefinedEdits
@DefinedEdits Год назад
great tutorial, I appreciate it
@veerchauhan5906
@veerchauhan5906 Год назад
I am getting this type of error can someone help me.? local variable 'response' referenced before assignment
@papersworktm
@papersworktm 6 месяцев назад
I don't know why, but bot recives empty messages from server, even if i type "Hey" or "Roll".
@R1perXNX
@R1perXNX Год назад
hai un inglese che fa paura, non ti avrei mai scambiato per italiano se non fosse per il sistema operativo, complimenti!
@lordender_kitty_official
@lordender_kitty_official Год назад
6:27 isn't that character a back tick? also known as a grave. `. it's usually right above the tab key and beside the 1 key. pressing it while holding shift gives a tilde ~.
@pilotgfx
@pilotgfx Год назад
depends on the layout , for me i have to shift + the button left to backspace: ` , and without shift: ´ , holding alt gr: | (public service info
@loganeast3901
@loganeast3901 8 месяцев назад
My thoughts exactly. I know it as a back tick from experience programming, but I was shocked to hear him say "you'll just have to copy it from the internet". Although with the state of minimalistic keyboards these days maybe it's not surprising. Maybe I'm old school but I'm still running with the whole works: Querty, F1-F12, Esc, System keys (Print screen, Insert, Delete, etc.), NumPad, arrow keys, and an additional M1-M5
@truesentrie1185
@truesentrie1185 Год назад
I fear what happens to this guy if Nintendo sees this
@Indently
@Indently Год назад
I think there will be no trace of me left on the internet, and in real life.
@tokyodynamite6497
@tokyodynamite6497 Год назад
ty for the video. super easy to follow
@G3rryx
@G3rryx 2 года назад
Parli veramente bene inglese + bravissimo. Grazie mille !
@grilcovin5900
@grilcovin5900 Год назад
I did everything in the tutorial but in the end no matter what I write he doesn't respond and the message says "user said ' ' (channel)" what do I do ?
@teluguanimeguy8627
@teluguanimeguy8627 Год назад
same problem br0 but at first the code ran successully without error but my bot was not running then i went to botghost to make it online but now it is not responding EVEN IT IS ONLINE
@shajiratulyaqueen
@shajiratulyaqueen Год назад
for some reason when i try to access the contents of the message, it returns an empty string. i used the exact same code as the video suggested, anyone has any idea what to do?
@eliptically9439
@eliptically9439 Год назад
same
@RobinToshFr
@RobinToshFr Год назад
@@eliptically9439 same
@smhgeko
@smhgeko Год назад
hi, any way to fix the issue "AttributeError: module 'bot' has no attribute 'run_discord_bot'"? I'm coding in vscode
@KrissyClaw
@KrissyClaw 6 месяцев назад
Restarting the project helped me. I was in VSCode myself.
@justecho5760
@justecho5760 Год назад
I don't know why but my bot only in private messages
@pete8420
@pete8420 Год назад
the '`' key will often show up as the squiggly '~' key to the left of your '1' key that is on the number row.
@drewplays69
@drewplays69 Год назад
bro has no sounds
@Indently
@Indently Год назад
try unmuting the video
@MrLucaslucal
@MrLucaslucal 10 месяцев назад
Thank, you helped me a lot!
@Glintuu
@Glintuu Год назад
Thanks, this helped alot. :)
@bejrtj
@bejrtj 9 месяцев назад
400 Bad Request (error code: 50006): Cannot send an empty message, When I send a message on discord it detects I have send an empty message. Why and how do I fix it?
@03tg
@03tg 8 месяцев назад
same here . did u get it fixed?
@bejrtj
@bejrtj 7 месяцев назад
@@03tg no. I dunno what is the error, I tried searching on the web for other ways to get the message and send it since this way is clearly broken but found nothing. Can anyone help us?
@jimfrootloopfilledbrain
@jimfrootloopfilledbrain 5 месяцев назад
Sometimes when I send a long message it says Cannot send an empty message. What do I do?
@UnderRostaReal
@UnderRostaReal Год назад
inport random def handle_response(message) -> str: p_message = message.lower() if p_message == 'hello': return 'Hello' if p_message == 'roll' return str(random
@jynx2949
@jynx2949 2 года назад
How would I get it to respond with my discord username in the responses .py?
@HenkJan-n7v
@HenkJan-n7v Год назад
if you guys dont know what program hes using to code its pycharm
@syl-does-games
@syl-does-games 2 года назад
Good tutorial! A few hiccups but browsing the comments should give you enough info to get it working :)
@Indently
@Indently 2 года назад
Happy it worked for you! I know they had a recent update which absolutely destroyed 99.99% of all Discord tutorials recently. But I'll make sure to make an updated one in the winter time. Thanks, and happy coding!
@syl-does-games
@syl-does-games 2 года назад
@@Indently
@Neqless
@Neqless 5 месяцев назад
I get this Error: NameError: name 'TOKEN' is not defined Although it is defined with like this: TOKEN = "MYTOKEN" client = discord.Client() Please help meeee
@a.ielimba78
@a.ielimba78 5 месяцев назад
default authorization link not popping up for me
@DaRollinThunder
@DaRollinThunder Год назад
Hey, first off thanks for the vid. I was having a bit of trouble and I can't seem to find the answer. How do I actually run the main on python to get that interface? ( 4:19 ) I keep getting the cmd for python
@FollowAll-p7r
@FollowAll-p7r Год назад
I just get the error "400 Bad Request (error code: 50006): Cannot send an empty message" please help what did I do wrong
@RobinToshFr
@RobinToshFr Год назад
same
@Thepinneother
@Thepinneother 8 месяцев назад
ok... u did NOT tell me how to open a python file, good tutorial dude.
@Indently
@Indently 8 месяцев назад
I recommend learning Python first before looking at Python tutorials. You got this man!
@KishanSuhirthan
@KishanSuhirthan 5 месяцев назад
tbh thats a skill issue
@WilliamW1979
@WilliamW1979 Год назад
The key is the top left most key on your keyboard, to the left of 1. It is how you do comments in Discord.
@kamizzard3721
@kamizzard3721 Год назад
I am using python 3.8 but when I type in 'pip install discord' I get an error
@Woidon123
@Woidon123 Год назад
try to update pip - worked for me
@Plain-_-
@Plain-_- Год назад
hey just wanted to say I found the tutorial really helpful. I just have one problem, when I'm trying to run my bot in Pycharm to make it come online it gives me an error saying this Client.__init__() missing 1 required keyword-only argument: 'intents' and I have no clue what this means. I tried looking up what it means and found nothing. Can someone please help?
@RonaldSteezly
@RonaldSteezly Год назад
Same issue
@samsstuff2078
@samsstuff2078 Год назад
if somebody is facing any problem with intents please substitute client for this: client = discord.Client(intents=discord.Intents.default())
@actuallyandroid5700
@actuallyandroid5700 Год назад
@@samsstuff2078 thank you so much. tried to get this working for weeks and this is the only thing that has worked.
@Deathcleaver
@Deathcleaver 9 месяцев назад
@@samsstuff2078 thanks man
@Ouzzel
@Ouzzel Год назад
People are saying this is a good tutorial, but he's not really explaining anything...
@Ogamer320
@Ogamer320 2 года назад
It doesnt work i have 36 errors bc of that
@MuhammadSohaib-lx1mz
@MuhammadSohaib-lx1mz Год назад
how can i fix this erro "TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents'"
@KaliopaTsutomu
@KaliopaTsutomu Год назад
im making loads of bots for my own server now :D
@rausgetappt
@rausgetappt Год назад
Why shouldn't I give my bot admin, he can do everything below, so I don't have to click on everything right?
@eliptically9439
@eliptically9439 Год назад
if someone hacks your bot they have infinite power over your server
@rausgetappt
@rausgetappt Год назад
@@eliptically9439 ah ok, thanks
@DIS_VR
@DIS_VR Год назад
it does not show bot in authorized method.
@PigeonIsPosh
@PigeonIsPosh Год назад
i noticed when you are opening Pycharm, there is code already in terminal which i dont have? why
@ari_theflower
@ari_theflower Год назад
what was the code?
@Th3RazieI
@Th3RazieI Год назад
Telling me the Module "discord" is missing. Any1 able to help?
@jewel2265
@jewel2265 Год назад
i have the same problem
@klipk7296
@klipk7296 Год назад
Why does every single tutorial have a completely differenty code structure to the point where it looks like a different language. Why are beginners guides so complicated
@Indently
@Indently Год назад
What do you want a professional to say to that
@ari_theflower
@ari_theflower Год назад
I don't know if you're still having trouble, but there's strength in numbers, right? If you would like, I could walk you through how I was able to do it? on a discord call or whatever you would prefer,
@liinter5990
@liinter5990 2 года назад
someone help I am getting the message File "C:\Users\Liinter\PycharmProjects\pythonProject1\main.py", line 4, in bot.run_discord_bot AttributeError: module 'bot' has no attribute 'run_discord_bot'
@deathvaisen6381
@deathvaisen6381 9 месяцев назад
Can anyone help.The code understands sent messages as nothing just space.
@Praisethesvn
@Praisethesvn Год назад
for some reason it does not appears to me the in app authorization option
@Jack-fi7lj
@Jack-fi7lj Год назад
my bot dosnt go online it says it couldnt find discord after a install it
@macc9667
@macc9667 Год назад
can someone help me? the debug says that the bot did send the message , but the message is " "( empty , aka it isnt sending a message )
@AboodyHandal
@AboodyHandal Год назад
i found the solution replace the line with : client = discord.Client(intents=discord.Intents.all())
@IceGrave
@IceGrave Год назад
im having the same issue, did you figure it out? If so, tell me if you can.
@macc9667
@macc9667 Год назад
@@IceGrave sadly , i didnt find any solutions :/
@cioce
@cioce 8 месяцев назад
why it says that i need more modules after installing discord
@alexventel9567
@alexventel9567 6 месяцев назад
I can help you if you want
@st0rm-xx
@st0rm-xx Год назад
the backwards "ticks" is just the key next to 1 (tidal key)
@ME-kl9bj
@ME-kl9bj Год назад
it took hours of overlooking just 50 lines of code to change message author to message channel.
@JcatTV
@JcatTV Год назад
i dont understand, how do you have multiple files in the same section?
@_Tech_Kid_
@_Tech_Kid_ Год назад
dont even work
@afeef5226
@afeef5226 2 года назад
every time I run the program it gives me this Traceback (most recent call last): File "C:\Users\afeef\PycharmProjects\bot\main.py", line 4, in bot.run_discord_bot() File "C:\Users\afeef\PycharmProjects\bot\bot.py", line 18, in run_discord_bot client = discord.Client() TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents' am I doing somthing wrong?
@elitefn6674
@elitefn6674 2 года назад
I have this problem too
@elitefn6674
@elitefn6674 2 года назад
Have you found a fix?
@afeef5226
@afeef5226 2 года назад
@@elitefn6674 nah man not yet :(
@elitefn6674
@elitefn6674 2 года назад
@@afeef5226 try this client = discord.Client(intents=discord.Intents.default()) or this client = discord.Client(intents=discord.Intents.all()) Also enable intents in discord developer portal, I messed around with it for a while and it ended up working when I enabled all intents in discord developer portal (in "bot" section) and had my client as: client = discord.Client(intents=discord.Intents.all())
@gl1tch393
@gl1tch393 2 года назад
change run_discord_bot thing to client = discord.Client(intents=discord.Intents.default())
@sphoofxd2499
@sphoofxd2499 2 года назад
when i run the code it says that it expected an "Except" block, but i did exactly what you did. here is the complete error: await message.author.send(response) if is_private else await message.channel.send(response) ^ SyntaxError: expected 'except' or 'finally' block
@Indently
@Indently 2 года назад
expected 'except' or 'finally' block, you did not do exactly as I did, 100%.
@ari_theflower
@ari_theflower Год назад
did you figure it out?
@whiskyinsv
@whiskyinsv Год назад
the "In app Authorization" option is missing for me and I cannot create a url...
@ari_theflower
@ari_theflower Год назад
have you fixed it?
@nitgo3451
@nitgo3451 Год назад
So this is the guy from the meme
@VaibhavShewale
@VaibhavShewale Год назад
need update on code
@lxvndrv_
@lxvndrv_ Год назад
why i can't seen the add bot button like 3:40 ?
@MindUnearthed
@MindUnearthed 11 месяцев назад
How do I Install the pip install discord? It says Failed Building wheel for yarl
@Capoo_GorillaTag
@Capoo_GorillaTag Год назад
What happens when you use administator
@RenderBenderProductions
@RenderBenderProductions 10 месяцев назад
bro im getting an error on line 4 and line 15 please someone help
@X0xi3
@X0xi3 Год назад
How add the bot to ur server after creating it with a tablet and phone?
@Ouzzel
@Ouzzel Год назад
Could someone explain line 8 of bot.py? I dont understand whats going on here.
@ME-kl9bj
@ME-kl9bj Год назад
if there's any weird things going on it will say "e" in the terminal
@the_untextured
@the_untextured Год назад
grande! Grazie mille!
@GrunkyGun
@GrunkyGun Год назад
5:53 what is that little , thing there at 1,6 is that a , or not send the thingy pls
@ThePinkShark._0fficial
@ThePinkShark._0fficial Год назад
What about the redirect url they have now? this was the most updated thing i could find
@Webbyhx
@Webbyhx Год назад
Splendido video, grazie mille
@bubax7476
@bubax7476 4 месяца назад
can i code this in C# ?
@veradavampire4861
@veradavampire4861 Год назад
my bot doesn't even go online pls help
@asirenenthusiast
@asirenenthusiast Год назад
*You shouldnt share it with anybody* *me copying down his token 2 seconds later*
Далее
Can You Get Every Discord Badge?
9:44
Просмотров 2,4 млн
+1000 Aura For This Save! 🥵
00:19
Просмотров 7 млн
I made a Discord Bot that says Choo Choo
33:15
Просмотров 41 тыс.
Creating Jarvis powered by OpenAI and Python | ChatGPT
18:40
How ChatGPT Built My App in Minutes 🤯
8:28
Просмотров 2,5 млн
10 Important Python Concepts In 20 Minutes
18:49
Просмотров 134 тыс.
How to Build a Discord Bot
4:41
Просмотров 236 тыс.
I tried Discord Bot Makers...
14:19
Просмотров 125 тыс.
5 Useful F-String Tricks In Python
10:02
Просмотров 308 тыс.
+1000 Aura For This Save! 🥵
00:19
Просмотров 7 млн