Learn How to Make a Python Discord Bot in 17 Minutes. Host for Free!

Поделиться
HTML-код
  • Опубликовано: 19 июн 2024
  • Understand how to code a discord bot without spending an hour watching a tutorial. Our goal is to cut all the fat from learning and allow you to move onto bigger and better things!
    After this python tutorial you will be able to create a custom discord bot from scratch. In this video we will cover responding to message events and creating bot commands. As well as how to get an API key and creating your server.
    ‪@CSDojo‬
    00:00 Intro
    00:30 Create Server
    01:17 Create Bot and Get API Key
    03:27 Code Bot
    12:35 Witty Responses
    💾 Check out the code!
    replit.com/@JacobLower3/Repli...
    🌎Free hosting!
    repl.it/claim?code=claritycod...
    🔑Get your API Key
    / discord
    Want to chat with me and other programmers join our discord!
    / discord
    #pythontutorial #discordbot #claritycoders
  • НаукаНаука

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

  • @MohammedUsaid
    @MohammedUsaid 3 года назад +7

    Thank you so much for this video, I had requested this on CS Dojo's vid on the Telegram bot and you had said it was a good idea. Thanks a lot for listening to the request. I randomly had a thought of visiting your channel to check if you may have done it and I was in luck, fabulous timing! I will try to make a bot fosure

    • @ClarityCoders
      @ClarityCoders  3 года назад +3

      Glad you stopped by! Keep the good ideas coming.

    • @MohammedUsaid
      @MohammedUsaid 3 года назад +3

      @@ClarityCoders Haha thanks, subscribed! I had a question, how would I use the bot to mention users using @?
      For eg: trigger code is $Hello
      DiscUser: $Hello
      Bot: Hello @DiscUser
      or
      trigger: !hello
      DiscUser: !hello @AnotherUser
      Bot: Hello @AnotherUser

  • @cosmxcsneaky8490
    @cosmxcsneaky8490 2 года назад +1

    THANK YOU holy crap I suck at coding you made it so easy! Another sub

  • @mikitaslabysh8271
    @mikitaslabysh8271 2 года назад +10

    Man you got some amazing tutorials, thank you, you deserve more views and subscribers

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      Thanks! As long as someone is watching and learning I'll keep doing them no worries.

  • @ilikelobsters.2376
    @ilikelobsters.2376 2 года назад +4

    who else doesn't know anything about coding and python but wants to make a bot?

  • @ELDhouse
    @ELDhouse 3 года назад +8

    Great job on walking through the code and explaining the components!

  • @ralphcalzada4767
    @ralphcalzada4767 3 года назад +3

    YOU, MY MANNN, ARE UNDERATED. cant wait for your channel to blow up!!

    • @ClarityCoders
      @ClarityCoders  3 года назад

      I hope your right haha. At any rate I appreciate the comment and views!

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

    Finally, a video where I actually have my Bot responding. Thank you ever so much. 100% appreciated!

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

      Great to hear! Thanks for watching and commenting.

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

    Hey Bro thanks for the video!

  • @stormmllertolshave5968
    @stormmllertolshave5968 2 года назад

    I like your voice! Its quite calming!

  • @hooker7459
    @hooker7459 2 года назад +1

    Thank goodness, the time had come i managed write my first accurate pythons coding

  • @shnitzellink4833
    @shnitzellink4833 3 года назад

    Ur channel is great I was very surprised to see that you're not more popular! I guess I'm part of the OG club

    • @ClarityCoders
      @ClarityCoders  3 года назад

      forever I won't forget schnitzel the OG! hahs

  • @Rouja1
    @Rouja1 2 года назад +1

    I was stuck for ages trying to get me bot to turn on, thank you so much!

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      Thank you for watching and commenting.

  • @kalen8110
    @kalen8110 2 года назад

    Hello for me it says in lane nine list index out of range and its the same as it is in the video. Does anybody know how to fix this?

  • @triambtalwar1393
    @triambtalwar1393 3 года назад +1

    Great video. Gonna make a bot tomorrow

    • @ClarityCoders
      @ClarityCoders  3 года назад +1

      Thanks! If you have any issues let me know.

    • @triambtalwar1393
      @triambtalwar1393 3 года назад +1

      @@ClarityCoders It's working perfectly. Thank you so much!

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

    hey! i tried it out and ran it then only the packages popped up but it didn't continue to run it stopped after how do i fix this?

  • @dogalkaynaksu9385
    @dogalkaynaksu9385 3 года назад

    Hello, i want to make a Reddit bot for download saved pictures or videos on my Reddit account. How can i make it? Thanks!

  • @HkLearnsAI
    @HkLearnsAI 2 года назад

    can you help me it says:
    Traceback (most recent call last):
    File "main.py", line 7, in
    async def on_ready():
    TypeError: event() missing 1 required positional argument: 'coro'

  • @hmrajesh3
    @hmrajesh3 3 года назад +1

    Bro please create a tutorial with combination of Google spreadsheet (eg : stock screener) + telegram bot + python. Basic if we give input to bot it has to fetch the rows and columns from the spreadsheet and give us the data. There is no video related on internet. It's and humble request bro.

    • @ClarityCoders
      @ClarityCoders  3 года назад +2

      Thanks for the idea I'll put it on my todo list!

  • @lolgaminghcr2498
    @lolgaminghcr2498 2 года назад +1

    it`s always showing "syntax error: invalid syntax" and my bot go offline

  • @webrevolution.
    @webrevolution. 2 года назад +1

    Very cool video.
    I run New York btw.

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      Town I run is much smaller.

    • @webrevolution.
      @webrevolution. 2 года назад

      @@ClarityCoders Lucky you man. Running NY is exhausting.
      Also lonely island says it in their song.

  • @Tufted
    @Tufted 2 года назад +1

    hey the code says its already redeemed and i cannot turn on always on

  • @x9im
    @x9im 2 года назад

    I wish I could turn on the always on setting without hacker subscription

  • @KiNG-ef8we
    @KiNG-ef8we 2 года назад +3

    someone can help with this ?
    Traceback (most recent call last):
    File "main.py", line 4, in
    client = discord.client()
    TypeError: 'module' object is not callable

    • @petsdom
      @petsdom 2 года назад

      change the small c of the client to capital C that will fix it!

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

      @@petsdom i tryed, it did'nt work? heres the code
      client = discord.Client()

  • @Daniel-jg4wk
    @Daniel-jg4wk Год назад +1

    Great tutorial, although i got stuck due to an error:
    Traceback (most recent call last):
    File "main.py", line 4, in
    client = discord.Client()
    TypeError: __init__() missing 1 required keyword-only argument: 'intents'

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

      intents = discord.Intents.default()
      intents.message_content = True
      client = discord.Client(intents=intents)
      use that instead of client = discord.Client()

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

    Can I do it on pycharm?

  • @amanroy1049
    @amanroy1049 3 года назад +1

    Works great. Thanks. Just can't get the subscription through your link.

    • @amanroy1049
      @amanroy1049 3 года назад

      Just checked it again. Everything's working fine. Thanks again.

    • @ClarityCoders
      @ClarityCoders  3 года назад

      Awesome did you get the free hosting if not let me know.

    • @demischi3018
      @demischi3018 3 года назад

      @@ClarityCoders tried to claim the free hosting link in the description, it doesn't work. Nothing happens on that screen after hitting enter.

  • @volle6400
    @volle6400 2 года назад

    How to dowland the csv?

  • @trev110
    @trev110 3 года назад

    6:55 whenever I run the code after finishing this step, it claims that the “my_secret” line is invalid (invalid syntax)

    • @ClarityCoders
      @ClarityCoders  3 года назад +1

      Join our Discord and send something to our help channel we can get it figured out.

    • @trev110
      @trev110 3 года назад

      @@ClarityCoders I went ahead and just copied the code into another repl and it seems to work now, but thank you :)

  • @Dope-to5pi
    @Dope-to5pi 3 года назад

    How can I claim the free hosting

  • @Dem4L
    @Dem4L 2 года назад +1

    It started working for like 20 seconds then said I was blocked from accessing the API because I clicked “Run” too many times /:

    • @Dem4L
      @Dem4L 2 года назад +1

      Note to self, don’t click “run” 5 times -_-

  • @Nightdesert1202
    @Nightdesert1202 2 года назад

    Hey, it says Expected an indented block at the logged in now command, how do I fix this?

    • @ClarityCoders
      @ClarityCoders  2 года назад

      Make sure your indents match mine exactly! They matter in Python.

  • @fawl1273
    @fawl1273 2 года назад

    Could you make a kick and ban command

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

    It says that it’s WRONG at ”on_ready”

  • @dosamigos3142
    @dosamigos3142 2 года назад

    Hey, I Love this Video But A Problem is Ocurring Please help me.
    File "main.py", line 23
    elif "$Thought" in message.content:
    ^
    IndentationError: unindent does not match any outer indentation level

    • @dosamigos3142
      @dosamigos3142 2 года назад

      Please tell Me The solution asap

  • @Dope-to5pi
    @Dope-to5pi 3 года назад

    How can I claim it

  • @waziegaming7422
    @waziegaming7422 2 года назад

    Traceback (most recent call last):
    File "main.py", line 11 in
    my_secret = os.environ['TOKEN']
    NameErroe: name 'os' is not defined
    pls help

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      import os
      make sure thats at the top of your file.

  • @tanlilian9925
    @tanlilian9925 2 года назад

    Uhm i kinda have a little issue here 😅 whenever i run it it says "Traceback (most recent call last):
    File "main.py", line 4, in
    cleint = discord.Cleint()
    AttributeError: module 'discord' has no attribute 'Cleint"
    Yea-

    • @ClarityCoders
      @ClarityCoders  2 года назад

      you spelled client wrong. 😂 It happens.

    • @tanlilian9925
      @tanlilian9925 2 года назад

      @@ClarityCoders Ouhhhh that makes more sense-

  • @philippurwoko
    @philippurwoko 2 года назад

    So Repl.it can host python 24/7 for free. Does it mean I can Host nodejs webserver in Repl.it 24/7 for free too ?

    • @ClarityCoders
      @ClarityCoders  2 года назад

      Well it's only free for a couple months then you have to pay for the hacker plan. You could also use a ping script to host it for free after trial ends.

  • @Nekroz05
    @Nekroz05 2 года назад +1

    Is this deprecated? I saw a few video for making bots but when i try, it's no longer viable.

    • @light9808
      @light9808 2 года назад

      It shouldnt be. Works fine for me.

  • @mihkelmalv946
    @mihkelmalv946 2 года назад

    Traceback (most recent call last):
    File "main.py", line 13, in
    print(dir(message))
    NameError: name 'message' is not defined
    can someone help me

  • @coldcoffeebutstilltired.4704
    @coldcoffeebutstilltired.4704 2 года назад

    i cant find the key can you help me?
    edit: aka link

  • @ananthsriram9722
    @ananthsriram9722 2 года назад

    can I get the CSV file

  • @kilnareth7970
    @kilnareth7970 3 года назад

    Anyone still has a fix regarding async def bein an invalid syntax?

  • @Kaje376
    @Kaje376 2 года назад

    Hey, it tells me that the code has been already redeemed, would appreciate it you could add a new one :)

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      I'll hit them up and see what I can do.

  • @music-heart3121
    @music-heart3121 2 года назад +1

    Bhai all are saying thank you but my python says os not defined

  • @phantavius
    @phantavius 2 года назад

    Do one for role management.

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      Really good idea. I'm like 95% sure this will be in my next 5 videos.

    • @phantavius
      @phantavius 2 года назад

      @@ClarityCoders appreciate it. :)

  • @AnthonyWho
    @AnthonyWho 3 года назад

    whats your discord server

    • @ClarityCoders
      @ClarityCoders  3 года назад

      discord.gg/cAWW5qq stop by and say hi!

  • @joshuasimmons571
    @joshuasimmons571 2 года назад

    instead of mentioning the user can you @ everyone??

  • @epicone8953
    @epicone8953 2 года назад

    Do that video

  • @shaoliroy6469
    @shaoliroy6469 2 года назад

    bruh how do i get the csv file?

  • @masculine.brotherhood
    @masculine.brotherhood Год назад +1

    To Fix: TypeError: __init__() missing 1 required keyword-only argument: 'intents'
    Change:
    client = discord.Client()
    To:
    client = discord.Client(intents=discord.Intents.default())
    You're welcome.

  • @LucasFromGuam
    @LucasFromGuam 2 года назад

    what does the csv file look like in excel?

  • @kn1gh1f1re
    @kn1gh1f1re 2 года назад

    issue is there

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

    Sorry, 1st use vs code or pycharm 2nd YOU NEED INTENTS!

  • @Dope-to5pi
    @Dope-to5pi 3 года назад

    It just shows the code

    • @ClarityCoders
      @ClarityCoders  3 года назад

      You sure you don't have it already? Try to turn always on - on

  • @MasonJerman
    @MasonJerman 2 года назад

    SIU?!? you must be near me. E or C?

    • @ClarityCoders
      @ClarityCoders  2 года назад +1

      Maybe.... haha. My brother went there at one time. C

  • @rip_jxofvrr
    @rip_jxofvrr 2 года назад

    doesn't work

    • @ClarityCoders
      @ClarityCoders  2 года назад

      It does! Something must be off if you join our discord we should be able to help.

  • @RonnieBlaze281
    @RonnieBlaze281 2 года назад

    replit deactivated your code already

  • @hanjiawang9507
    @hanjiawang9507 3 года назад

    DO you know how to make another @client.event
    async def on_message(message):
    if message.content.startswith("____"):
    await message.channel.send(f"______!") because when i make another, it just doesn't work

    • @ClarityCoders
      @ClarityCoders  3 года назад

      Don't make another @client.event just nest them inside with if statements for example
      if message.content.startswith("$greet"):
      await message.channel.send(f"Hello! How are you {message.author}")
      elif message.content.startswith("something else remember case matters!"):
      response = phrases[random.randint(0, len(phrases) - 1)]
      await message.channel.send(response)
      elif "$thought" in message.content:
      response = phrases[random.randint(0, len(phrases) - 1)]
      await message.channel.send(response)

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

    The Totorial is great! I only got stuck on line four, heres the code:
    client = discord.Client()
    Error message:
    Traceback (most recent call last):
    File "main.py", line 4, in
    client = discord.Client()
    TypeError: __init__() missing 1 required keyword-only argument: 'intents'