The EASIEST Discord Chat Bot Tutorial On The Internet (Python 3.10) 2023
Vložit
- čas přidán 30. 06. 2024
- Today I will be showing you how you can create a working Discord Bot in less than 20 minutes using Python 3.10. I REALLY recommend you use PyCharm for this if you're new to coding.
Learn how to make an accurate chat bot: • How to create an accur...
Formatted !help: `YOUR MESSAGE IN HERE`
00:00 Intro
00:22 Discord Package
01:16 Developer Portal
06:07 Coding The Bot
18:00 Running The Bot
▶ Become job-ready with Python:
www.indently.io
▶ Follow me on Instagram:
/ indentlyreels
For the 2024 version + source code:
czcams.com/video/UYJDKSah-Ww/video.html
Great tutorial !
Easy to setup and to understand, still leveling up my Python skills, thanks a lot !
Thanks for putting this together! I was able to resolve an issue due to intents and used this template as a way to make a discord bot to track Wordle stats on the server I share with my friends. We’re looking forward to seeing who is the best at Wordle!
How did you resolve this issue may I ask?
what a shame he never responded@@anponmon
This Video is really helpful. I am beginner in Python an could create a chatbot with the help of this Video. It is a little chatbot owl, which wants Chips. And if you ask how many, I build in the random integer function, which gives out a number between 1 and a Million (It is a very hungry owl). It is fun and easy, if you follow the steps of the tutorial.
Great tutorial, it worked in a single go. Thanks, man.
I have enabled the MESSAGE CONTENT INTENT, SERVER MEMBERS INTENT, and PRESENCE INTENT but my bot is still not responding to messages, is there something else that I need to do to fix this issue?
Got lost in the documentation trying to make my bot work, went to your tutorial and I can finally get a 'Hello World!' from my bot! Thank you!
This video was so helpful, thank you for making it! I had absolutely no experience coding with Python and now I have a working Discord bot! I am just curious if you have any other tutorials on how to use the "responses" and/or "beautifulsoup" packages with a Discord bot? I'd love to learn how to get my Discord bot to pull content from webpages into its responses (like a daily horoscope). Thanks again!
Thank you so much, i'm doing a discord bot for my studies final project and this video is the first one to work for me :D is very well explained and usefull to start with, you deserved this one +1 subscriber
do you know how to fix this error (TypeError: run_discord_bot..on_message() takes 0 positional arguments but 1 was given)? I followed the video completely, the bot runs just when I type a response I get that error.
@@nox7796 check if you have included 'message' in the on_message function:
async def on_message(message):
# rest of the code...
Thank you so much! Works very well
This was indispensable in writing my first bot! thank you!
Wonderful!
THANK U SO MUCH I APPRECIATE THIS WAS SUPER EASY AND HELPFUL!!!
VS Code users who get Syntax Error from File , line 1:
Close your terminal from the first step (pip install discord) and run the program from a fresh terminal.
Excellent tutorial!
Thanks for the video :D
Thank you so much! This helped with my school project!!
If you are getting and SSL certification error,
1. run pip install certifi and pip install --upgrade certifi
2. run /Applications/Python\ 3.10/Install\ Certificates.command and replace 3.10 with whatever the first two numbers are when you run python --version (so 3.10.23 is just 3.10 and 3.11.43 is just 3.11)
tysm it works now
Hi, your content is great and i have learned alot from it. Thanks for sharing.
Can you also make an video for chat bot for vicidial (asterisk)
thank u. First tutorial that helped me get my bot working : )
Very helpful and up-to-date tutorial, subscribed!
Nice, it worked in a single go!
my bot is just reading " " from the messages being send to it
took forever but i got it omg amazing
Great vid! made a secret santa bot for the holidays. Thanks!
Great Vid. Thank you.
Very helpful thank you so much
Well, i have tried it, and it works perfectly! Great!
Thank you very much... It worked out
10:05 if message == "roll"
make sure its p_message and not message.
small typo but thats okay.
this small typo would throw error on every usage of roll command..... thanks
Great video
Thank You Sooo much
Yo Awesome TY!
Thanks for all of your help I really appreciate it
Thanks, also one question for this project, does this has more functionality than responding? I am curious if i can make something else of it, btw tysm.
Thank you so much! The only problem I had was with permissions, so guys don't forget to allow all three 'Privileged Gateway Intents' in 'Bot' section :D
Thanks so much. The gateway intents were my problem and your comment helped me resolve it. Much appreciated.
The button ' ` ' is usually located under your escape key! Nice video!!
I have an Italian keyboard so I only have | \ under the esc key, I'm sure with minimal research I could find it ahah.
Had an error with pip install:
I had to change from powershell in the terminal to the command prompt as for default it was powershell for some reason.
Thanks for the tutorial. By the way will you do tutorials for mojo too, when it comes out officially?
I would like to try it, but I can't promise anything.
4:17 Bots cannot delete your server unless they are the owner of that server, and there aren't really any servers owned by bots so it can't delete your server, but it can nuke it.
i did exactly how you showed me but the bot is unable to read the message being sent on the channel. the debugging line you provided, its printing just a blank space on the console window. please help
Great tutorial. Maybe you could do a video on keeping your bot online? Even hosting it on a cloud VM, mine seems to disconnect after a few hours
But put the Token into a .env file, hope that helps!
@@niterleski I did some research and problem is (as always ) my code :D
@@niterleski wdym by that? i have the same problem
run the code on virtual machine and but nohup infront of the running command that should work
I finally made it! After watching about 4 tutorials, and this one giving me the final touches, I managed to make a Discord Bot.
Just one plus I'd like to remind to anyone who, like me, foolishly named the .py files as Responses and Bot, with upper case instead of lower case. You just have to write it in upper cases while programming about these files, exactly as the file name, otherwise it won't work.
thanks
Good video thanks
Is this beginner friendly? I’m very new to Python but I have to submit a project in a few weeks for a course I’m taking
Huge life saver
Achievement unlocked: Make your first discord bot thanks to a dude on the internet. Cheers for the great tutorial mate!
still works in 2023! thank you!
omg thank you so much!!
Mine isnt working, is there anything you did different and is the venv folder required?
@@tntaco07 to be honest, I don't know. First I started the code with this video czcams.com/video/hoDLj0IzZMU/video.html and then reading the comments I realized that code isn't working anymore bc the intents are needed, so I just put them and worked.
also man im not sure if you have videos on how to dow things on commands but if you dont please make some. That would be really nice
yeah thank you so much man
How do I manually set the difference between whether or not a message is meant to be private?
It works perfectly, but whenever i send a text message it only displays on the terminal and the bot does not respond at all in Discord itself. How do I fix this one?
Has this tutorial yet again become outdated? Well, aw shucks. Even with this reoccurring issue of these tutorials rapidly becoming outdated wicked quick, I simply must say that your tutorials are the best on the platform. I've tried finding alternative tutorials that are newer, and thus aren't up to date, but they either are also out of date or should probably be alright (published two months ago) but are just so low quality that I just refuse to even try with them. If you were to chose to upload yet another video on this very interesting topic, I'd be overjoyed. It's annoying how formats change and ruin all decent information that was available. For real though, if you or somebody else were to upload an updated video on discord bot creation, that'd be soooooo unimaginably awesome. Very high quality tutorial, though; +1 subscriber.
This bot tutorial is not outdated and works perfectly, as of today at least.
@@Indently doesnt work now
when I click run, it says that run_discord_bot() is not working idk!
works for me. Double check you copied the code EXACT
@@kouanime.
When I run it, it’s says “AttributeError: module ‘bot’ has no attribute ’run_discord_bot’ how do I fix that?
I built the code exactly as you wrote it and it didn't work. I even copy and pasted from your source code. Still no good. All I get is a TON of "Traceback (most recent call last)" stuff. It looks like maybe it has problems with the bot.run_discord_bot() code in the main,py module and the client.run(TOKEN) in the bot,py module.
Any thoughts?
Edit: Changed the periods in the modules to commas so that they aren't links
i have the same problem
i had the same problem... i just reset my token and pasted the new one .... and make sure you have toggled the message content intent in the discord developer portal/applications/bot .... and lastly recheck that if you have typed uppercase letters and lowercase letters in place in the code... I'm certain it will work... hope it helps.. even tho you posted the problem a month ago-
7:48, I foresee many users who don't know about the font that makes the arrows look that way will be confused by what you wrote there
I sometimes encounter errors stating that it has exceeded the API limit even though the server has only been receiving 2 messages or reactions at a time in a short while. How do I fix this?
module not found. no module named discord. i have uninstalled and reinstalled discord using pip. please help
I was wondering, how would I make it so that bot does a new line in the same command for things such as bullet points? i can't figure out how to di it.
i keep getting this error: module 'bot' has no attribute 'run_discord_bot' . its from this line: bot.run_discord_bot() . does anyone know why?
TAK!! Havde nogle gamle scripts liggende til discord bots som ikke virker længere, hvorfor ved jeg ikke.. Tror bare det er blevet opdateret men den har video har hjulpet :D
Happy this worked and helped :)
@@Indently En video ide: en troll discord bot hvor den fx auto responder til en bestemt person og sender random memes, videoer, rick roll etc. Men tak for det!
@@cy_xyz I like the idea! I will write it down.
im having an issue where it is saying that discord is not a module and it will not let me use it but it allows everything else in the discord install i see it install a module for discord but it says it doenst exist
This is great, but are there also ways to use the discord api to connect to voice?
Hey awesome tutorial, quick question, how can I make the bot return multi line statements? Because I would like it to print many things in the discord channel at once (I plan on printing all of the coordinates on a 2d array) but I dont know how because at the moment it only returns 1 string statement.
Don't forget about "
" which is a line break character
Hey! Great video! Is it possible to send a message to a bot that isnt mine which has joined my personal channel?
I added the roll command but when I say the thing I put down for it, the bot ignores and just returns the "Type !help for really good help." How do I fix this?
Great tutorial! However, once the bot is running, how can I make edits or changes to the code (if I want to add more responses). I can't seem to find a way to make any updates to the code once the bot is online.
in the response tab
7:57 how did you get the arrow to show up when making the "get response function show up as a string?
just use ->
I'm getting the AttributeError: module 'bot' has no attribute 'run_discord_bot'
I followed all the steps you showed us in the video, but something is wrong and I can't run my bot unfortunately
in the video at 18:00 i dont see the green arrow what do i do, it also wont let me import discord, it said
ModuleNotFoundError: No module named 'discord'
First pip install discord in the terminal
It keeps telling me: cannot access local variable 'response' where it is not associated with a value.
I’ve rewritten the code and it STILL keeps giving me this message?
hey so i cant seem to install discord basically its says i have installed it in the terminal but when i type import discord there is a error
Could you point to some resources where I can learn more about how all these functions work so I can make some more advanced stuff. I have some experience in programming but I can't find good info on this stuff.
You can also use Bot command its much eazier or/and make in class
Its working, thanks a ton, how to make it more advance? suggest me some resources, please!
when i runvmain i get AttributeError: ‘Intents’ object has no attribute ‘message_content’
i just want to know why my bot wont respond to any of the commands
no matter what
i tried my best to find errors and change them
but for some reason it just doesn't respond
PLEASE HELP ME MR.Indently!!!
PLEASSSSEEEEE
same bro
I want to make my bot register a certain message in a server and then write a private response. Is that possible?
how do i fix this error message
AttributeError: 'Intents' object has no attribute 'messages_content'
Having a lot of problems with the pip install discord part
Had the same issue. You need to install it manually through the python packages at the bottom
do you have the latest version of Python installed? It should come with the pip package
I dont know if its late but try installing it with cmd and in the project settings choose another python if you have diferent
Did you install pip?
For everyone who still has this problem: my friend and I had the same issue and it was fixed by using an older version of python.
I finished the video, but when I type in chat I only get messages sent to my dm rather then the channel. What could be causing this?
In the debug print, the bot is not reading a single character, it returns to me always an empty string whatever I type. The code is the same as the video, any ideas?
getting error module 'responses' has no attribute 'get_responses'
I have a "Select redirect URL" and i cant seem to get it to go away and invite my bot, im wondering whats going on, if you can please help.
When I try to exit it says to terminate the process 'main' and doesent give me options to not terminate and to keep it running
thanks a lot
now i want to add my own commands, where and how ?
Hello,
I am trying to create this bot yet I am having errors.
I have followed everything exactly as you showed however I am receiving an SSL error, whether this is due to me being on a Mac or something else I do not know.
Could you guide me in the right direction?
i have a problem the bot doesnt respong and this message shows up in the terminal
module responses has no attribute get_response
Ye check your typing
the ` character is the key under Esc & above Tab aka ~ key
hope that helps
when I try to install discord it says "'pip' is not recognized as an internal or external command,
operable program or batch file." any idea why?
reinstall python, and while reinstalling python check mark the box which says "install pip" and also check mark box that says "add to path variable"
I need some help with downloading Python. I have downloaded python, but doesn't match to the one in the video and I am very confused
The bot isnt sending responses, but in the terminal in VSCode it can see im sending messages, has anybody had a similar issue?
im not seeing sent messages even
i had a problem following the tutorial but was able to fix it see my other comment.
My Run tab seems to say I have "ModuleNotFoundError" for import bot and import responses.. is there a fix to that? This is my first bot
Can you make full tutorial for NextCord module?
Does this still work ?
Cause my bot suddenly stopped working today.
Throws the exception e
Whenever I try and add the 'import discord' thing it says there's an error and that there isn't a module named discord. I ran the 'pip install discord' command just fine though. Any ideas as to why this could be happening?
close and re open the project
Check "inherit global site-packages" when creating the project.
i struggled with this but then I highlighted the import discord and somehow some "install" option came up, after that it worked
if any of it doesnt work then do that pip install in command prompt of windows
Hey!,So uhh When i want to run it It Doesn't look Perfect (Error) I'm Using Replit. How do i fix that? Thank you.
i literally did the same thing but my bot keeps sayin i don't understand your message when i say hello in the channel , but if i said it in the private it will responde with hello there
How did you do that arrow...
How do i get the venv folder? If its supposed to be there from a new project i didnt get it
create a python environment within your IDE