Create Your Own Discord Bot in Python 3.12 Tutorial (2024 Edition)

Поделиться
HTML-код
  • Опубликовано: 17 янв 2025

Комментарии • 194

  • @Indently
    @Indently  Год назад +24

    Source code:
    github.com/federicoazzu/discord_tutorial_2024

  • @siddhartharao4127
    @siddhartharao4127 11 месяцев назад +82

    I had been searching for a proper tutorial on a discord bot using python, but I couldn't find one since every video was outdated , and the documentation also made no sense. Thanks for the great work.

    • @Indently
      @Indently  11 месяцев назад +8

      Glad I could help!

  • @Q.Roo_0
    @Q.Roo_0 Год назад +58

    I have never heard of the walrus operator. Just that alone made watching this video worth my while.

    • @terribletimmy2
      @terribletimmy2 10 месяцев назад +2

      Recent addition to Python! Just learned about it as well

    • @tjb3171
      @tjb3171 9 месяцев назад +1

      same lol

    • @artnaz
      @artnaz 6 месяцев назад

      I believe it was introduced in Python 3.8. Not that "recent" 🙂

    • @Issma62
      @Issma62 6 месяцев назад

      Literally the same 😂🤔

  • @TheOnlyCurd
    @TheOnlyCurd 11 месяцев назад +7

    This helped me a lot thank you.Keep up the work it really high quality

  • @Overlycomplicatedswede
    @Overlycomplicatedswede 8 месяцев назад +3

    Jag är så glad, folk som dig är göra guider för python liksom andra kodning språk!
    Kärlek från Sverige!

    • @Indently
      @Indently  8 месяцев назад +2

      Kul att se en svensk i kommentarerna, jag håller på att lära mig svenska just nu :)

    • @Overlycomplicatedswede
      @Overlycomplicatedswede 8 месяцев назад +1

      @@Indently ja, jag såg du kommer från danmark o jag bestämde mig för att lämna en vänlig kommentar

  • @TonyStark-lg7cw
    @TonyStark-lg7cw 11 месяцев назад +10

    Thank you so much for this tutorial, I followed along and created my own Discord Bot!

    • @Indently
      @Indently  11 месяцев назад +1

      Glad it helped!

  • @DanielTheOcto
    @DanielTheOcto 9 месяцев назад +20

    As someone who doesn't even own a computer and is borrowing one let alone how to code, this worked flawlessly. It's really easy once you get over the first few hurdles of installing everything correctly

    • @ilikecreeper331
      @ilikecreeper331 8 месяцев назад +2

      how's coding for you now?

    • @DanielTheOcto
      @DanielTheOcto 7 месяцев назад +3

      @@ilikecreeper331 if you're asking if I've improved, not really. I only made a discord bot for an april fools gag for a couple of my friends. It does seem fun to learn later down the line if I ever do

    • @ilikecreeper331
      @ilikecreeper331 7 месяцев назад +1

      @@DanielTheOcto well you’ll get there
      Speaking of discord bots I’m learning how to build one with python recently too

    • @embs4814
      @embs4814 7 месяцев назад +1

      @@DanielTheOcto WOuld you mind explaining how you got over the pip install issues? I cant find anything.

    • @DanielTheOcto
      @DanielTheOcto 7 месяцев назад

      @@embs4814 unfortunately I do not remember

  • @sSessionn
    @sSessionn Год назад +7

    Hi, this video was very helpful to me. I hope you will continue to bring content regarding creating a discord bot in python and in a future video you will discuss the use of embeds, welcome messages, buttons, moderation functions and so on. I have so many questions haha

  • @developer_anonymous
    @developer_anonymous 7 месяцев назад +26

    0:35 Dont use `discord`, use `discord.py`, `discord` is a mirror package, even the README in PyPi shows this warning.
    8:42 Please, explain better Intents, Intents are the different things your bot wants to recieve from the Gateway & API, not some sort of permissions...
    10:30 No!! Check if the message has any embeds or attachments rather than just saying that intents are not set up.
    14:22 No need for the `elif`s, if any `if` block check is met then it will return something... I can't really explain myself here but no needs did elif
    18:20 No need for those variables...
    19:58 Why do you still have that "one liner check"? Just use if blocks, it makes readability better
    Also, why make a `responses.py` file? I thought you were using clean python practises, and that is NOT a good python practise.
    Anyways, good vid

  • @ivyw777
    @ivyw777 9 месяцев назад +1

    I made it!🙂Thank you. I got my first bot running.

  • @sarojmaharjan3986
    @sarojmaharjan3986 4 месяца назад

    This tutorial is by far the most useful one for starting a general simple discord bot! Really appreciate it. Thank you !

  • @ClaireNighten
    @ClaireNighten 5 месяцев назад

    This is amazing! thank you for such a lovely tutorial!

  • @alejandroperezl
    @alejandroperezl Год назад +7

    Thanks for the video and all the contents you’ve created. I’ve recently bought a couple of Udemy courses from you and they’re amazing. Congrats.

    • @Indently
      @Indently  Год назад +4

      A huge thanks for the support! It means a lot!:)

  • @chanlers
    @chanlers 7 месяцев назад

    literally the best tutorial ever... worked like a charm. thank you!!

  • @hustlej
    @hustlej 11 месяцев назад

    Coded my first discord bot today with your video, now i'm using the code to learn further into adding more features and stuff to my bot! thank you for the super easy to follow tutorial

    • @brien.
      @brien. 11 месяцев назад

      super cool, good luck with your coding journey!

    • @dzelezny
      @dzelezny 4 месяца назад

      hey, how is your journey going?

  • @ravenlb
    @ravenlb Год назад +2

    Great job, well presented - thanks!

  • @justinserota3406
    @justinserota3406 5 месяцев назад

    Awesome tutorial, thank you!

  • @CooperStaz
    @CooperStaz 3 месяца назад

    Great video! Especially for programmers who are just getting into their programming journey.

  • @thebetsnameverlol1531
    @thebetsnameverlol1531 11 месяцев назад +6

    followed the tutorial but the bot doesn't response in the channel, only private messages. can you help?

  • @korneldekany6689
    @korneldekany6689 4 месяца назад

    This was realy helpful thanks!

  • @shrijitmajumder4411
    @shrijitmajumder4411 6 месяцев назад

    Thanks for this awesome project

  • @kiss6917
    @kiss6917 Год назад +2

    Thank you for this so much! Now I am well on my way to creating an AI chatbot using python for discord!

  • @ProjectMarzDev
    @ProjectMarzDev 7 месяцев назад

    this was very easy i have barely ever coded with pyuthon but i have learned alot jsut becyse of this tutorial thank you so much!

  • @FousmanFous
    @FousmanFous 8 месяцев назад

    I made my first bot , i will say big thank you for all! ❤

  • @someone-04r
    @someone-04r 9 месяцев назад +3

    Im print "TOKEN", but the out is: "None"

  • @LukasCarrein
    @LukasCarrein 5 месяцев назад +1

    14:11 why dont you use " instead of ' it means you dont have to do the \

  • @__fiamy
    @__fiamy Месяц назад

    thanks! great tutorial

    • @Indently
      @Indently  Месяц назад +1

      Glad it was helpful!

  • @cristiangaming5019
    @cristiangaming5019 Год назад +5

    I tried your code and i got a error on line 5 theres no module named discord

    • @Jaden_YaLor
      @Jaden_YaLor 11 месяцев назад +4

      i had the same problem, so my suggestion is making sure its "discord" and not "Discord", as that was the problem for me when I got the same error message. If that doesn't work, then idk I'm pretty beginner at coding :|

    • @ECThrowaway
      @ECThrowaway 11 месяцев назад

      Look up what pip is, it will change the way you code

    • @st_9278
      @st_9278 11 месяцев назад +1

      Also you need to have pip installed firstly

  • @LearnwithChampzz-rv4lk
    @LearnwithChampzz-rv4lk 7 месяцев назад

    Nicely presented!

  • @DynastyRealism
    @DynastyRealism 8 месяцев назад +2

    So, it says everything is all good and up and running. Everything is exact as the video. But when I text in the channels, it won't respond. But when I text using the ? then thats when it works and goes to DMs. What's wrong? Why won't it work normal?

  • @rawsnot
    @rawsnot 5 месяцев назад +1

    When I run my program I don't get the red messages.

  • @kongle8737
    @kongle8737 Год назад +2

    when I try to make the .env file it just turns into a text file and everything in it is gray and doesnt work

  • @lildigy2175
    @lildigy2175 Месяц назад

    I'm so mad it isn't working the terminal is blank whenever i try to run it please advise on a solution.

  • @SWJaeTee
    @SWJaeTee 4 месяца назад

    I code in C# and that Walrus operator blew my mind

  • @mustafauludogann
    @mustafauludogann Год назад +1

    Thank you

  • @josephsalazar6096
    @josephsalazar6096 7 месяцев назад +1

    im stuck at 7:35 from dotnev import load_dotnev I have a bug saying Cannot find reference 'load_dotenv' in '__init__.py' I can't figure out how to fix it

    • @sandwichs8592
      @sandwichs8592 6 месяцев назад

      do you know if you have dotenv library installed on your machine? Sounds like python is trying to find the function, but can't find the package directory. Also make sure everything is spelled correctly.

    • @vrajved
      @vrajved 6 месяцев назад

      @@sandwichs8592 could youhelp me out? i have it installed but ModuleNotFoundError: No module named 'dotenv' error keeps persisting

    • @st4rtechofficial
      @st4rtechofficial 21 день назад

      @@sandwichs8592 thanks, I had the same problem and didn't know I should've installed it... but know it works :)

  • @maexle14
    @maexle14 Год назад +2

    Can you make a tutorial, how to add slash commands to THIS Version of a Discord Bot? But good job, thanks

  • @avosc5316
    @avosc5316 10 месяцев назад

    Thanks!

  • @cxzirey
    @cxzirey 4 месяца назад

    thanks man

  • @bmaify
    @bmaify 10 месяцев назад +1

    Received an error saying: 'token' is not identified. When I look through the Discord_Token i noticed it's not highlighted in green like in the tutorial, but otherwise I followed everything normally. The code does print my token as it did in the tutorial. Is there a fix? Please and thank you
    Edit: I figured it out.

  • @fly-lioxit0
    @fly-lioxit0 10 месяцев назад +1

    How can I make it to show the commands available like any other discord bot?

  • @joewipat5452
    @joewipat5452 9 месяцев назад +1

    I have an error AttributeError: 'Intents' object has no attribute 'message_content'. Has the docs changed because I am getting it when I run your code and the one I wrote

  • @Neqless
    @Neqless 9 месяцев назад

    If you get the error with "intempered token was passed" or something, you have to save the file after putting in the token in .env.
    This will fix it

  • @caeleng5553
    @caeleng5553 11 месяцев назад +1

    Great video! I am a bit confused what the .venv file is for though?

    • @bartuslongus
      @bartuslongus 9 месяцев назад +2

      The venv (virtual environment) folder is for storing the project specific modules without changing the global one. In this case we have the standard Python modules in there plus the modules installed witht pip: discord and dotenv.

  • @ezirimkingdom
    @ezirimkingdom 3 месяца назад

    Thanks alot, this really helped. How do i host it, so it keeps running?

  • @lainp1lledd
    @lainp1lledd Год назад +1

    Hi, I really liked the video! Can you show us how to implement a RUclips video tracking functionality (like Pingcord)? I've looked online but I can't find a way to do this since I'm not the owner of the RUclips Account whose videos I wanna be reminded of. Thanks :)
    EDIT: Also slash commands please!!

  • @SynthStep20
    @SynthStep20 5 месяцев назад +1

    I need help!! When running the code at main() it says "ImportError: cannot import name 'get_response' from 'responses'"

    • @meowecat
      @meowecat 5 месяцев назад +2

      I have that too

  • @m7mdnho154
    @m7mdnho154 10 месяцев назад

    New into bots and python.
    Thanks for the tutorial 🩷

  • @BruvCode
    @BruvCode 8 месяцев назад

    Thanks for the information. I have now created my Discord Bot and its online but it wont respond to any message I type. Can you please re-upload this video and also add the chapter "Fix the bot when not responding to any messages"

  • @diegojose3863
    @diegojose3863 11 месяцев назад +1

    I followed the steps to this tutorial to a T, but I get stuck on the SSL certification. It states that my certification isn't valid, however I already updated it and all

    • @klaft5228
      @klaft5228 9 месяцев назад

      Me too! did you find a fix? let me know please! thanks.

    • @sandwichs8592
      @sandwichs8592 6 месяцев назад

      depending on your version of Python, you should have a install certificates.command in your python folder I believe and that fixes the problem for most users. If you copy and paste the last line of the error code into your web browser you should be able to find some solutions if it is a certificate problem on the internet.

  • @그러나-c7b
    @그러나-c7b 9 месяцев назад +2

    there is no get_response(function) :

  • @cocbeanj2419
    @cocbeanj2419 6 месяцев назад

    my bot just never responds, ive gone through tut twice now and it just ignores me

  • @idonthaveideaofname.-.5281
    @idonthaveideaofname.-.5281 3 месяца назад

    thank you for this tutorial, i have been looking for a good discord bot tutorial, but for some reason the "import os" section does not work as ""os" is not accessed by Pylance"

  • @cosmosinity
    @cosmosinity 8 месяцев назад

    For some reason, the bot won't go offline, how do i make it go offline??

  • @lukaskjekken3313
    @lukaskjekken3313 Год назад +3

    Hi! Really love the tutorial. Was just wondering, cause when I try to run the script I get a error message saying "asyncio.run() cannot be called from an running event loop", I just can't figure out what is causing this error.

    • @memze1148
      @memze1148 9 месяцев назад

      ask chatgpt

  • @11305205219
    @11305205219 5 месяцев назад

    what is the between pip install discord and discordpy

  • @ayushlamsal7044
    @ayushlamsal7044 10 месяцев назад

    i did it, all works well. except the bot endlessly responds to itself. it does not do that for default response for only for (hello and bye )though

  • @shreyaanshpurohit9292
    @shreyaanshpurohit9292 3 месяца назад

    yo, i got an error saying its an ssl error, how do i fix, i am on MacOS 15 Python 3.13

  • @ghostshotxx6005
    @ghostshotxx6005 Месяц назад

    from dotenv import load_dotenv isnt working it says ImportError: cannot import name 'load_dotenv' from 'dotenv'

  • @yoimiyasimpu8757
    @yoimiyasimpu8757 7 месяцев назад

    my bot doesn't seem to be responding back but all the code and setup is the same? Only difference is I used Visual Studio Code

  • @PengKun-py7md
    @PengKun-py7md 10 месяцев назад

    tanks this video a lot. ❤you can't believe how long i debug my program just because missing click message content

  • @chartingwithliv
    @chartingwithliv 9 месяцев назад +1

    from dot_env import load_dotenv
    ModuleNotFoundError: No module named 'dot_env'

  • @ayam3330
    @ayam3330 10 месяцев назад

    That's work, but only on my channel where I'm as an owner, but it didn't work on my friend channel where I'm as an admin and my friend as an owner. I don't really understand discord 😢

  • @Zai_sssss
    @Zai_sssss 10 месяцев назад

    I tried to gave it the permissions it didnt let me and sent me to a website that said "page not found".

  • @marcodegner7599
    @marcodegner7599 10 месяцев назад +2

    Hello
    I have some problems, can someone help me?
    Unresolved reference 'dotenv'
    Unresolved reference 'load_dotenv'
    Unused import statement 'from discord import Intents, Client, Message'
    Unused import statement 'from discord import Intents, Client, Message'
    Unused import statement 'from discord import Intents, Client, Message'

    • @Zumbisinho
      @Zumbisinho 9 месяцев назад

      Do you put in the terminal
      "pip install python-dotenv"?

  • @royser_king6627
    @royser_king6627 2 месяца назад +2

    o ana mskin w7lt f str lkhr mablanch kolchi f7ran o ana la

  • @Spngie
    @Spngie 8 месяцев назад

    what program are you using for this

    • @FlyingFrets
      @FlyingFrets 8 месяцев назад

      looks like visual studio code

    • @Sushi-wp8mg
      @Sushi-wp8mg 7 месяцев назад +2

      he is using PyCharm

  • @lewie8136
    @lewie8136 Месяц назад

    Theres no option to allow the bot to read messages as shown in your video

    • @BigEmster
      @BigEmster Месяц назад

      it was renamed to "view channels"

    • @lewie8136
      @lewie8136 Месяц назад

      @@BigEmster thanks

  • @sabatin056nn
    @sabatin056nn 6 месяцев назад

    i have problem in dotenv , He says there is an error in this word (dotenv)

  • @vishalgreat5154
    @vishalgreat5154 7 месяцев назад

    When I run the code. It has no result. What should I check

  • @ItzClinky
    @ItzClinky 9 месяцев назад

    pip is not working for me what else can I use?

  • @szymetrix5946
    @szymetrix5946 10 месяцев назад +1

    from dotenv import load_dotenv
    ModuleNotFoundError: No module named 'dotenv' help me

    • @koro6072
      @koro6072 10 месяцев назад

      did you do pip install for dotenv?

    • @Neoneedx
      @Neoneedx 9 месяцев назад

      Thank you so much, I did not install it ​@@koro6072

  • @redluigi2020
    @redluigi2020 6 месяцев назад

    pip isnt working for me do i have to download something for it?

  • @M1lesSeen_Y0u
    @M1lesSeen_Y0u 6 месяцев назад

    It updated again!

  • @corbinalt1773
    @corbinalt1773 8 месяцев назад

    I recieved SO many errors and when I clicked the link to show me where it was it pulled up a bunch of random code that I never wrote nor could I edit it because it was read only. It went down into thousands of lines of code. I think it has something to do with the new intent stuff but I have no clue what to do about it. I coded everything exactly as is in the video. Can someone help?

  • @TeamEliteFG
    @TeamEliteFG 3 месяца назад

    i thought env was only for js

  • @mofiro6758
    @mofiro6758 3 месяца назад +1

    Too many one liner which makes it super hard for normal devs to read the code. Remember a code is written once and read like 10 times. Always write one more line but keep it readable. I say this as a senior developer.

    • @affleckverse4995
      @affleckverse4995 2 месяца назад

      Yeh exactly its sometimes hard for me as i am a beginner to python

  • @n1N0v8
    @n1N0v8 11 месяцев назад

    for some reason when I run nothing happens at all

  • @SMHTEAM24
    @SMHTEAM24 6 месяцев назад

    Brother whenever I'm trying to print the Token it's printing out None....Do you know the reason?

    • @달영혼
      @달영혼 Месяц назад

      make sure your .env file has the token in there still

  • @GAMINVR
    @GAMINVR 7 месяцев назад

    how do i make the bot send a image

  • @Wallee580
    @Wallee580 Год назад

    I don't think he understands how much some Linux users love the terminal. xD
    I'm legit working on a file manager for it. You may be asking why, and I'll tell you the reason is "why not"?

  • @Sslifer01
    @Sslifer01 7 месяцев назад

    Well my bot is not running.

  • @reaperdreamer8082
    @reaperdreamer8082 7 месяцев назад

    My venv is not showing up. I've searched everywhere and I still don't know why. Anyone have a solution?

  • @TeclisIluminador
    @TeclisIluminador 7 месяцев назад

    Nice video!!!

  • @PuneetSinha-gb8ri
    @PuneetSinha-gb8ri 9 месяцев назад

    Could you please help URL generator is not visible for me

  • @samukaze5810
    @samukaze5810 5 месяцев назад

    At this point PyCharm is sponsored by Indently 💀

  • @Tims2kool
    @Tims2kool Год назад

    im doing this on replit. would there be any difference?

    • @saggybelt
      @saggybelt 11 месяцев назад

      secret instead of .env

  • @cuoreribelle4584
    @cuoreribelle4584 8 месяцев назад

    hi, but is it also possible to send a ddos ​​attack?

    • @sandwichs8592
      @sandwichs8592 6 месяцев назад

      The bot should not be able to send a ddos attack because Discord will rate limit your bot, which is a HTTP error forcing your bot to disconnect and go offline.

  • @Oksamokki
    @Oksamokki 8 месяцев назад

    mine says : cdc is not defined.

  • @jonnyaepmp4
    @jonnyaepmp4 10 месяцев назад

    yo buddy.. when i ran main 8:07 ... for me this comment popped up
    PS C:\Users\jonan> & C:/Users/jonan/AppData/Local/Programs/Python/Python312/python.exe d:/main
    Traceback (most recent call last):
    File "d:\main", line 3, in
    from dotenv import load_dotenv
    ModuleNotFoundError: No module named 'dotenv'
    what did i do wrong and how do i fix it

    • @jonnyaepmp4
      @jonnyaepmp4 10 месяцев назад

      pls help as quick as possible

    • @POGranola
      @POGranola 10 месяцев назад +1

      whenever you did "pip install python-dotenv" on the cmd, if did a message pop up saying that it wasn't in your path?

  • @Konatoast
    @Konatoast 5 месяцев назад

    doesnt work anymore i tried it, also wrong discord import

  • @chandusharma205
    @chandusharma205 Год назад

    nxt part when?

  • @luckofgaming930
    @luckofgaming930 6 месяцев назад

    Somehow dotenv doesnt work in my case can anyone help me?

  • @ElmVanO
    @ElmVanO Год назад +4

    keep getting the error no module named dotenv

    • @carterlewkowski9126
      @carterlewkowski9126 11 месяцев назад

      Did you run the pip install python-dotenv command?

  • @aDushandrii
    @aDushandrii Год назад +1

    Last time i tried to learn python few years ago, and i don't remember this stuff with colons. All this stuff like "lowered : str =..." or "intents: Intents" = ... or "client: Client = ..." etc. Is this something new? I failed to even properly google it.

    • @lelouchlamperouge3676
      @lelouchlamperouge3676 Год назад

      well you are basically defining the TYPE of that variable you are mentioning

    • @zerodrip669
      @zerodrip669 11 месяцев назад

      it's a discord/api thing lol. "lowered: str", however, is simply declaring the variable type for `lowered`.

  • @AnonymousGaming69420
    @AnonymousGaming69420 Год назад +1

    good video

  • @krishnapathak292
    @krishnapathak292 10 месяцев назад

    it says NONE for print(TOKEN)

  • @Haa_di
    @Haa_di 5 месяцев назад

    can you please make a video on makin whatsapp chatbot

  • @SaintsPurgatory
    @SaintsPurgatory 7 месяцев назад

    20 minutes to respond to users? You apparently need to work on your descriptions for your vods.

    • @Indently
      @Indently  7 месяцев назад

      I don't know what else a chat bot is supposed to do if not "respond to users" lmao

    • @meowecat
      @meowecat 5 месяцев назад

      @@Indently 20 minutes?

  • @ewmc2
    @ewmc2 2 месяца назад

    doesnt work