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!
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?
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)
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!
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.
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.
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!
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
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 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-
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'
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.
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.
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
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.
@@Indently I mean I know python, I don't know any external stuff, I have a certificate for gods sake. But you never really explained how to get the files linked to the bot
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
I have a problem with the if user_message[0] = '?' Each time i type something in discord, it gives me an IndexError: string index out of range. Can anyone please tell me why is it happening?
@@tntaco07 to be honest, I don't know. First I started the code with this video ua-cam.com/video/hoDLj0IzZMU/v-deo.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.
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
@@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!
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.
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?
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?
can anyone please help? i've double checked every line of code and yet, Traceback (most recent call last): File "C:\Users\user\PycharmProjects\pythonProject\main.py", line 4, in bot.run_discord_bot() AttributeError: module 'bot' has no attribute 'run_discord_bot' why can't i import the bot the same way i could import the responses?
what if it says C:\Users\Katsina\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\Katsina\PycharmProjects\kukibot2\main.py Traceback (most recent call last): File "C:\Users\Katsina\PycharmProjects\kukibot2\main.py", line 1, in import bot File "C:\Users\Katsina\PycharmProjects\kukibot2\bot.py", line 1, in import discord ModuleNotFoundError: No module named 'discord' Process finished with exit code 1 what should i do?
check if your filenames are named exactely like in the video. Otherwise check, if you have downloaded the discord import statement with "pip install discord".
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?
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.
Broo plz somebody help i did everything correct but I can't make the bot go online plzz help bro there isn't any error idk what is wrong When I run the main function it shows Syntax error: invalid syntax.
SOLUTIONS FOR THOSE GO GET PROCESS FINISHED WITH EXIT CODE 0 my indeentations were wrong, Make sure your indentations are right indentations are basically spaces at the beginning of a line for eg: def handle_response(): the space before def handle_response(): is called indentation
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.
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.
mine won't respond to my messages, i double checked like 10 times and stuff, at last i even gave it admin so i dont have to play around with permissions but whatever i do, it won't respond..
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?
hiya! for running the bot, atm i have an error 'AttributeError: module 'bot' has no attribute 'run_discord_bot' I followed your steps to a T and for some reason this is the only part I have an issue with. halp. tyia!
For the 2024 version + source code:
ua-cam.com/video/UYJDKSah-Ww/v-deo.html
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!
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?
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
took forever but i got it omg amazing
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
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.
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.
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!
my bot is just reading " " from the messages being send to it
This was indispensable in writing my first bot! thank you!
Wonderful!
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.
thank u. First tutorial that helped me get my bot working : )
Thanks for the video :D
Thank you so much! This helped with my school project!!
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!
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 keep getting this error: module 'bot' has no attribute 'run_discord_bot' . its from this line: bot.run_discord_bot() . does anyone know why?
Great vid! made a secret santa bot for the holidays. Thanks!
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
Man you're the best
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-
Nice, it worked in a single go!
I'm getting the AttributeError: module 'bot' has no attribute 'run_discord_bot'
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
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
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.
Achievement unlocked: Make your first discord bot thanks to a dude on the internet. Cheers for the great tutorial mate!
Thank you very much... It worked out
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
Great tutorial, it worked in a single go. Thanks, man.
When I run it, it’s says “AttributeError: module ‘bot’ has no attribute ’run_discord_bot’ how do I fix that?
Thank you so much! Works very well
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...
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
THANK U SO MUCH I APPRECIATE THIS WAS SUPER EASY AND HELPFUL!!!
Thanks for all of your help I really appreciate it
when i runvmain i get AttributeError: ‘Intents’ object has no attribute ‘message_content’
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.
I don't understand about the import bot part 16:18, I typed the same thing but bot isn't in scope
it doesn't work because u probably don't have a .py file called bot, he does. u probably just called it differently
Well, i have tried it, and it works perfectly! Great!
7:57 how did you get the arrow to show up when making the "get response function show up as a string?
just use ->
getting error module 'responses' has no attribute 'get_responses'
Great Vid. Thank you.
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.
how do i fix this error message
AttributeError: 'Intents' object has no attribute 'messages_content'
still works in 2023! thank you!
Very helpful and up-to-date tutorial, subscribed!
module responses has no attribute get_responses
Hi can you please tell me how to fix this problem?
if user_message[0] == '?':
~~~~~~~~~~~~^^^
IndexError: string index out of range
Any ideas?
Why does everyone in the comments act like this works? It just gives errors, and crucial steps are left out.
The ones who made it work know a little bit about programming, the tutorial works great as of 8 October 2023, nothing is left out.
@@Indently I mean I know python, I don't know any external stuff, I have a certificate for gods sake. But you never really explained how to get the files linked to the bot
Thank You Sooo much
mobule 'bot' has no attribute 'run_discord_bot'
anyone have the fix for this?
Happens for me too :( he doesnt seem to be answering comments so its probably just not gonna work :(
Great video
Very helpful thank you so much
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.
I have a problem with the
if user_message[0] = '?'
Each time i type something in discord, it gives me an IndexError: string index out of range. Can anyone please tell me why is it happening?
use double == i think
@@Lebron01234 is this solved?
@@TZCN idk
same problem here
enable message content intent in the developer bot tab under "Privileged Gateway Intents"
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 ua-cam.com/video/hoDLj0IzZMU/v-deo.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.
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.
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
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.
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
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
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"
My bot is running but won't respond to messages D:
yeah thank you so much man
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?
can anyone please help? i've double checked every line of code and yet,
Traceback (most recent call last):
File "C:\Users\user\PycharmProjects\pythonProject\main.py", line 4, in
bot.run_discord_bot()
AttributeError: module 'bot' has no attribute 'run_discord_bot'
why can't i import the bot the same way i could import the responses?
Hey I have the same problem, did you find a way of fixing it?
@@beta7436 you are importing the "bot" file that you created, make sure that the name is the exact same as the name of your file.
Having same issue with no luck fixing
Yo Awesome TY!
what if it says
C:\Users\Katsina\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\Katsina\PycharmProjects\kukibot2\main.py
Traceback (most recent call last):
File "C:\Users\Katsina\PycharmProjects\kukibot2\main.py", line 1, in
import bot
File "C:\Users\Katsina\PycharmProjects\kukibot2\bot.py", line 1, in
import discord
ModuleNotFoundError: No module named 'discord'
Process finished with exit code 1
what should i do?
check if your filenames are named exactely like in the video. Otherwise check, if you have downloaded the discord import statement with "pip install discord".
The solution for mine was in the discord developer portal, checking the intent boxes in the bot catergory
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?
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.
Broo plz somebody help i did everything correct but I can't make the bot go online plzz help bro there isn't any error idk what is wrong
When I run the main function it shows
Syntax error: invalid syntax.
Syntax error is when you wrote something weong in the code there should stand in wich line the error is
How do I manually set the difference between whether or not a message is meant to be private?
SOLUTIONS FOR THOSE GO GET PROCESS FINISHED WITH EXIT CODE 0
my indeentations were wrong, Make sure your indentations are right
indentations are basically spaces at the beginning of a line
for eg:
def handle_response():
the space before def handle_response(): is called indentation
thanks a lot
now i want to add my own commands, where and how ?
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)
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
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
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
Good video thanks
the ` character is the key under Esc & above Tab aka ~ key
hope that helps
Gracias! Hablo Espanol.
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
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
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.
Huge life saver
This is great, but are there also ways to use the discord api to connect to voice?
You can also use Bot command its much eazier or/and make in class
Hey! Great video! Is it possible to send a message to a bot that isnt mine which has joined my personal channel?
mine won't respond to my messages, i double checked like 10 times and stuff, at last i even gave it admin so i dont have to play around with permissions but whatever i do, it won't respond..
line 17, in run_discord_bot
intents.message_content = True
AttributeError: 'Intents' object has no attribute 'message_content'
You need to change:
intents = discord.Intents.default()
intents.message_content = True
To:
intents = discord.Intents.default()
intents.messages = True
@@tonnaa7140Thank you so much!!!
@@tonnaa7140 thanks a lot bruhh
@@tonnaa7140 thanks a lot!!
@@tonnaa7140 the messege equal string null what do to?
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?
thanks❣
My bot is online but cannot do ANY commands
hiya! for running the bot, atm i have an error 'AttributeError: module 'bot' has no attribute 'run_discord_bot' I followed your steps to a T and for some reason this is the only part I have an issue with. halp. tyia!
me too! i havent found a fix yet though.
How did you do that arrow...