The EASIEST Discord Chat Bot Tutorial On The Internet (Python 3.10) 2023

Sdílet
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

Komentáře • 420

  • @Indently
    @Indently  Před 5 měsíci

    For the 2024 version + source code:
    czcams.com/video/UYJDKSah-Ww/video.html

  • @Thars36
    @Thars36 Před rokem +21

    Great tutorial !
    Easy to setup and to understand, still leveling up my Python skills, thanks a lot !

  • @ultravphunter
    @ultravphunter Před rokem +14

    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!

    • @anponmon
      @anponmon Před rokem +3

      How did you resolve this issue may I ask?

    • @sockycheese4171
      @sockycheese4171 Před 9 měsíci

      what a shame he never responded@@anponmon

  • @silberkobold123
    @silberkobold123 Před rokem +8

    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.

  • @mridul_chandrawanshi
    @mridul_chandrawanshi Před rokem

    Great tutorial, it worked in a single go. Thanks, man.

  • @TheNUIHEO
    @TheNUIHEO Před rokem +17

    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?

  • @bt6972
    @bt6972 Před rokem +1

    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!

  • @kmlaplant
    @kmlaplant Před 11 měsíci +4

    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!

  • @Spluaks
    @Spluaks Před rokem +3

    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

    • @nox7796
      @nox7796 Před rokem

      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.

    • @bhavinthakur
      @bhavinthakur Před 11 měsíci +1

      @@nox7796 check if you have included 'message' in the on_message function:
      async def on_message(message):
      # rest of the code...

  • @cellsgis1105
    @cellsgis1105 Před rokem

    Thank you so much! Works very well

  • @jacoblingwall6767
    @jacoblingwall6767 Před 8 měsíci +1

    This was indispensable in writing my first bot! thank you!

  • @zeroesssssw
    @zeroesssssw Před rokem

    THANK U SO MUCH I APPRECIATE THIS WAS SUPER EASY AND HELPFUL!!!

  • @ethancox2025
    @ethancox2025 Před 6 měsíci +1

    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!

  • @camila3110
    @camila3110 Před rokem +2

    Thanks for the video :D

  • @jordanmelzer3371
    @jordanmelzer3371 Před 6 měsíci

    Thank you so much! This helped with my school project!!

  • @flytelp
    @flytelp Před rokem +9

    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)

  • @shirazchaudhry6573
    @shirazchaudhry6573 Před rokem

    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)

  • @DaJumba
    @DaJumba Před 6 měsíci

    thank u. First tutorial that helped me get my bot working : )

  • @FreadFries
    @FreadFries Před rokem +2

    Very helpful and up-to-date tutorial, subscribed!

  • @cdkw8254
    @cdkw8254 Před rokem

    Nice, it worked in a single go!

  • @Dandyboyo2
    @Dandyboyo2 Před rokem +4

    my bot is just reading " " from the messages being send to it

  • @allyscott6473
    @allyscott6473 Před rokem +4

    took forever but i got it omg amazing

  • @daspeedsta9455
    @daspeedsta9455 Před 6 měsíci

    Great vid! made a secret santa bot for the holidays. Thanks!

  • @X-razcal-X
    @X-razcal-X Před rokem

    Great Vid. Thank you.

  • @laak7982
    @laak7982 Před rokem

    Very helpful thank you so much

  • @perfectconversationmaker8765

    Well, i have tried it, and it works perfectly! Great!

  • @Foodislove2701
    @Foodislove2701 Před 5 měsíci

    Thank you very much... It worked out

  • @sprinter5901
    @sprinter5901 Před rokem +7

    10:05 if message == "roll"
    make sure its p_message and not message.
    small typo but thats okay.

    • @bhavinthakur
      @bhavinthakur Před 11 měsíci

      this small typo would throw error on every usage of roll command..... thanks

  • @grease253
    @grease253 Před rokem +1

    Great video

  • @kunalchauhan5294
    @kunalchauhan5294 Před rokem

    Thank You Sooo much

  • @8artvs
    @8artvs Před rokem

    Yo Awesome TY!

  • @vihaanuchiha3599
    @vihaanuchiha3599 Před rokem +1

    Thanks for all of your help I really appreciate it

  • @lejacobofficial
    @lejacobofficial Před rokem

    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.

  • @anezkaaa4071
    @anezkaaa4071 Před rokem

    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

    • @user-ew7et8jo7g
      @user-ew7et8jo7g Před 11 měsíci +1

      Thanks so much. The gateway intents were my problem and your comment helped me resolve it. Much appreciated.

  • @tinagervais
    @tinagervais Před rokem +1

    The button ' ` ' is usually located under your escape key! Nice video!!

    • @Indently
      @Indently  Před rokem +6

      I have an Italian keyboard so I only have | \ under the esc key, I'm sure with minimal research I could find it ahah.

  • @Austin_
    @Austin_ Před rokem +4

    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.

  • @nassosdimou3337
    @nassosdimou3337 Před 7 měsíci +1

    Thanks for the tutorial. By the way will you do tutorials for mojo too, when it comes out officially?

    • @Indently
      @Indently  Před 7 měsíci +1

      I would like to try it, but I can't promise anything.

  • @_lun4r_
    @_lun4r_ Před rokem +4

    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.

  • @firebolt3626
    @firebolt3626 Před rokem +2

    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

  • @cricketbatman
    @cricketbatman Před rokem +1

    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

    • @niterleski
      @niterleski Před rokem +1

      But put the Token into a .env file, hope that helps!

    • @cricketbatman
      @cricketbatman Před rokem +1

      @@niterleski I did some research and problem is (as always ) my code :D

    • @xkilluax_elo9842
      @xkilluax_elo9842 Před rokem

      @@niterleski wdym by that? i have the same problem

    • @dargus_
      @dargus_ Před rokem +1

      run the code on virtual machine and but nohup infront of the running command that should work

  • @julianavieira7065
    @julianavieira7065 Před rokem +6

    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.

  • @tonnaa7140
    @tonnaa7140 Před rokem

    Good video thanks

  • @DivaStyle0716
    @DivaStyle0716 Před rokem

    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

  • @Yzymo
    @Yzymo Před rokem

    Huge life saver

  • @BenAbode
    @BenAbode Před 11 měsíci

    Achievement unlocked: Make your first discord bot thanks to a dude on the internet. Cheers for the great tutorial mate!

  • @almighysanti3061
    @almighysanti3061 Před rokem

    still works in 2023! thank you!

  • @gimmecocho
    @gimmecocho Před rokem

    omg thank you so much!!

    • @tntaco07
      @tntaco07 Před rokem

      Mine isnt working, is there anything you did different and is the venv folder required?

    • @gimmecocho
      @gimmecocho Před rokem

      ​@@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.

  • @AnxiousAbstractifier
    @AnxiousAbstractifier Před rokem

    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

  • @EGG_BG
    @EGG_BG Před 5 měsíci

    yeah thank you so much man

  • @bigoz-fybb
    @bigoz-fybb Před rokem +1

    How do I manually set the difference between whether or not a message is meant to be private?

  • @prismaticgeek
    @prismaticgeek Před 8 měsíci +1

    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?

  • @ethanyoung.
    @ethanyoung. Před 11 měsíci +1

    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
      @Indently  Před 11 měsíci +1

      This bot tutorial is not outdated and works perfectly, as of today at least.

    • @kouanime.
      @kouanime. Před 10 měsíci +1

      @@Indently doesnt work now

    • @gusepep
      @gusepep Před 10 měsíci

      when I click run, it says that run_discord_bot() is not working idk!

    • @mattlo1664
      @mattlo1664 Před 8 měsíci

      works for me. Double check you copied the code EXACT
      @@kouanime.

  • @Fealinqs
    @Fealinqs Před 11 měsíci +2

    When I run it, it’s says “AttributeError: module ‘bot’ has no attribute ’run_discord_bot’ how do I fix that?

  • @defiantguru
    @defiantguru Před rokem +5

    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

    • @oppositeonion3871
      @oppositeonion3871 Před rokem

      i have the same problem

    • @include_na
      @include_na Před rokem

      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-

  • @Z3rk
    @Z3rk Před 6 měsíci

    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

  • @TheAceJ
    @TheAceJ Před rokem

    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?

  • @awaiszaffar8892
    @awaiszaffar8892 Před rokem +2

    module not found. no module named discord. i have uninstalled and reinstalled discord using pip. please help

  • @MoonDrive_
    @MoonDrive_ Před rokem

    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.

  • @2muchtntstudios925
    @2muchtntstudios925 Před rokem +3

    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?

  • @cy_xyz
    @cy_xyz Před rokem +1

    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
      @Indently  Před rokem +1

      Happy this worked and helped :)

    • @cy_xyz
      @cy_xyz Před rokem

      @@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!

    • @Indently
      @Indently  Před rokem

      @@cy_xyz I like the idea! I will write it down.

  • @svncobaltleader340
    @svncobaltleader340 Před rokem

    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

  • @cameronord7750
    @cameronord7750 Před rokem

    This is great, but are there also ways to use the discord api to connect to voice?

  • @mattlo1664
    @mattlo1664 Před 8 měsíci

    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.

    • @ImpossibleEvan
      @ImpossibleEvan Před 8 měsíci +1

      Don't forget about "
      " which is a line break character

  • @Alexander-mg4pr
    @Alexander-mg4pr Před rokem

    Hey! Great video! Is it possible to send a message to a bot that isnt mine which has joined my personal channel?

  • @TheOfficialAndGayBucket

    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?

  • @Minnie_Mandie
    @Minnie_Mandie Před rokem

    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.

  • @grayink1578
    @grayink1578 Před rokem +2

    7:57 how did you get the arrow to show up when making the "get response function show up as a string?

  • @James31006
    @James31006 Před rokem +3

    I'm getting the AttributeError: module 'bot' has no attribute 'run_discord_bot'

  • @ladiabloula
    @ladiabloula Před rokem +1

    I followed all the steps you showed us in the video, but something is wrong and I can't run my bot unfortunately

  • @MichealScars
    @MichealScars Před rokem +3

    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'

  • @snowy2747
    @snowy2747 Před rokem

    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?

  • @spider-ub4bk
    @spider-ub4bk Před rokem

    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

  • @mitri4939
    @mitri4939 Před 9 měsíci

    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.

  • @_Moonlight_22
    @_Moonlight_22 Před rokem

    You can also use Bot command its much eazier or/and make in class

  • @minhaj203
    @minhaj203 Před rokem

    Its working, thanks a ton, how to make it more advance? suggest me some resources, please!

  • @MistaYo9221
    @MistaYo9221 Před rokem +1

    when i runvmain i get AttributeError: ‘Intents’ object has no attribute ‘message_content’

  • @dhiyaneshrajappa9980
    @dhiyaneshrajappa9980 Před rokem +3

    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

  • @1990birk
    @1990birk Před rokem

    I want to make my bot register a certain message in a server and then write a private response. Is that possible?

  • @kentyamada6739
    @kentyamada6739 Před 11 měsíci +1

    how do i fix this error message
    AttributeError: 'Intents' object has no attribute 'messages_content'

  • @jeshc8424
    @jeshc8424 Před rokem +28

    Having a lot of problems with the pip install discord part

    • @desperbamboo
      @desperbamboo Před rokem +1

      Had the same issue. You need to install it manually through the python packages at the bottom

    • @ParadymShiftVegan
      @ParadymShiftVegan Před rokem

      do you have the latest version of Python installed? It should come with the pip package

    • @Lc9real
      @Lc9real Před rokem

      I dont know if its late but try installing it with cmd and in the project settings choose another python if you have diferent

    • @ImpossibleEvan
      @ImpossibleEvan Před 8 měsíci +1

      Did you install pip?

    • @jakobstrunck8944
      @jakobstrunck8944 Před 8 měsíci +1

      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.

  • @bekay7663
    @bekay7663 Před rokem

    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?

  • @SkM4rshall
    @SkM4rshall Před 8 měsíci

    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?

  • @SushiMuncher
    @SushiMuncher Před rokem +1

    getting error module 'responses' has no attribute 'get_responses'

  • @nathanmads7294
    @nathanmads7294 Před rokem

    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.

  • @gamingjimbo4898
    @gamingjimbo4898 Před 11 měsíci

    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

  • @haidaralshaar2547
    @haidaralshaar2547 Před rokem

    thanks a lot
    now i want to add my own commands, where and how ?

  • @raulrivera5492
    @raulrivera5492 Před 7 měsíci

    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?

  • @calebvargas9568
    @calebvargas9568 Před rokem +1

    i have a problem the bot doesnt respong and this message shows up in the terminal
    module responses has no attribute get_response

  • @multitude628
    @multitude628 Před rokem

    the ` character is the key under Esc & above Tab aka ~ key
    hope that helps

  • @emualmondo
    @emualmondo Před rokem +1

    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?

    • @0MEGA_
      @0MEGA_ Před rokem

      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"

  • @ladiabloula
    @ladiabloula Před rokem

    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

  • @morons9287
    @morons9287 Před 10 měsíci +2

    The bot isnt sending responses, but in the terminal in VSCode it can see im sending messages, has anybody had a similar issue?

    • @shaharzamir88
      @shaharzamir88 Před 10 měsíci

      im not seeing sent messages even

    • @michaellarsonlee
      @michaellarsonlee Před 9 měsíci

      i had a problem following the tutorial but was able to fix it see my other comment.

  • @Scepsis_
    @Scepsis_ Před 6 měsíci

    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

  • @LegitPlayerBS
    @LegitPlayerBS Před rokem

    Can you make full tutorial for NextCord module?

  • @lolonice9414
    @lolonice9414 Před rokem

    Does this still work ?
    Cause my bot suddenly stopped working today.
    Throws the exception e

  • @achilles8940
    @achilles8940 Před rokem +3

    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?

    • @sacksal
      @sacksal Před rokem

      close and re open the project

    • @skyekopiche
      @skyekopiche Před rokem +1

      Check "inherit global site-packages" when creating the project.

    • @Biggl
      @Biggl Před rokem

      i struggled with this but then I highlighted the import discord and somehow some "install" option came up, after that it worked

    • @sprinter5901
      @sprinter5901 Před rokem

      if any of it doesnt work then do that pip install in command prompt of windows

  • @thisaccium5155
    @thisaccium5155 Před rokem

    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.

  • @alix4dmeop
    @alix4dmeop Před 4 měsíci

    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

  • @official_steam
    @official_steam Před rokem +1

    How did you do that arrow...

  • @tntaco07
    @tntaco07 Před rokem +1

    How do i get the venv folder? If its supposed to be there from a new project i didnt get it