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

Sdílet
Vložit
  • čas přidán 4. 08. 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
  • Věda a technologie

Komentáře • 110

  • @ilikelobsters.2376
    @ilikelobsters.2376 Před 2 lety +4

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

  • @mikitaslabysh8271
    @mikitaslabysh8271 Před 3 lety +10

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

    • @ClarityCoders
      @ClarityCoders  Před 3 lety +1

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

  • @MohammedUsaid
    @MohammedUsaid Před 3 lety +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  Před 3 lety +3

      Glad you stopped by! Keep the good ideas coming.

    • @MohammedUsaid
      @MohammedUsaid Před 3 lety +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

  • @ralphcalzada4767
    @ralphcalzada4767 Před 3 lety +3

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

    • @ClarityCoders
      @ClarityCoders  Před 3 lety

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

  • @cosmxcsneaky8490
    @cosmxcsneaky8490 Před 2 lety +1

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

  • @missie8574
    @missie8574 Před rokem +2

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

    • @ClarityCoders
      @ClarityCoders  Před rokem

      Great to hear! Thanks for watching and commenting.

  • @ELDhouse
    @ELDhouse Před 3 lety +8

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

  • @shnitzellink4833
    @shnitzellink4833 Před 3 lety

    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  Před 3 lety

      forever I won't forget schnitzel the OG! hahs

  • @stormmllertolshave5968

    I like your voice! Its quite calming!

  • @SirWolf_Roblox
    @SirWolf_Roblox Před 2 lety

    Hey Bro thanks for the video!

  • @hooker7459
    @hooker7459 Před 2 lety +1

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

  • @Rouja1
    @Rouja1 Před 2 lety +1

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

  • @triambtalwar1393
    @triambtalwar1393 Před 3 lety +1

    Great video. Gonna make a bot tomorrow

    • @ClarityCoders
      @ClarityCoders  Před 3 lety +1

      Thanks! If you have any issues let me know.

    • @triambtalwar1393
      @triambtalwar1393 Před 3 lety +1

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

  • @kalen8110
    @kalen8110 Před 3 lety

    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?

  • @wonkft
    @wonkft Před 2 lety

    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?

  • @webrevolution.
    @webrevolution. Před 3 lety +1

    Very cool video.
    I run New York btw.

    • @ClarityCoders
      @ClarityCoders  Před 3 lety +1

      Town I run is much smaller.

    • @webrevolution.
      @webrevolution. Před 3 lety

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

  • @HkLearnsAI
    @HkLearnsAI Před 2 lety

    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'

  • @Tufted
    @Tufted Před 2 lety +1

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

  • @dogalkaynaksu9385
    @dogalkaynaksu9385 Před 3 lety

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

  • @lolgaminghcr2498
    @lolgaminghcr2498 Před 3 lety +1

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

  • @x9im
    @x9im Před 2 lety

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

  • @volle6400
    @volle6400 Před 2 lety

    How to dowland the csv?

  • @geraltofrivia9719
    @geraltofrivia9719 Před rokem

    Can I do it on pycharm?

  • @Dope-to5pi
    @Dope-to5pi Před 3 lety

    How can I claim the free hosting

  • @Dope-to5pi
    @Dope-to5pi Před 3 lety

    How can I claim it

  • @hmrajesh3
    @hmrajesh3 Před 3 lety +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  Před 3 lety +2

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

  • @fawl1273
    @fawl1273 Před 2 lety

    Could you make a kick and ban command

  • @ananthsriram9722
    @ananthsriram9722 Před 2 lety

    can I get the CSV file

  • @amanroy1049
    @amanroy1049 Před 3 lety +1

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

    • @amanroy1049
      @amanroy1049 Před 3 lety

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

    • @ClarityCoders
      @ClarityCoders  Před 3 lety

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

    • @demischi3018
      @demischi3018 Před 3 lety

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

  • @thequranichub
    @thequranichub Před 17 dny

    does it still work?

  • @Siggeeng
    @Siggeeng Před 2 lety

    It says that it’s WRONG at ”on_ready”

  • @trev110
    @trev110 Před 3 lety

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

    • @ClarityCoders
      @ClarityCoders  Před 3 lety +1

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

    • @trev110
      @trev110 Před 3 lety

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

  • @Nightdesert1202
    @Nightdesert1202 Před 3 lety

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

    • @ClarityCoders
      @ClarityCoders  Před 2 lety

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

  • @Daniel-jg4wk
    @Daniel-jg4wk Před rokem +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 Před rokem +1

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

  • @Crystanol
    @Crystanol Před 2 lety +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 Před 2 lety

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

    • @toffeecoffee_dev
      @toffeecoffee_dev Před rokem

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

  • @kilnareth7970
    @kilnareth7970 Před 3 lety

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

  • @coldcoffeebutstilltired.4704

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

  • @Dem4L
    @Dem4L Před 2 lety +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 Před 2 lety +1

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

  • @dosamigos3142
    @dosamigos3142 Před 2 lety

    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

  • @mihkelmalv946
    @mihkelmalv946 Před 2 lety

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

  • @tanlilian9925
    @tanlilian9925 Před 2 lety

    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  Před 2 lety

      you spelled client wrong. 😂 It happens.

    • @tanlilian9925
      @tanlilian9925 Před 2 lety

      @@ClarityCoders Ouhhhh that makes more sense-

  • @waziegaming7422
    @waziegaming7422 Před 2 lety

    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  Před 2 lety +1

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

  • @Nekroz05
    @Nekroz05 Před 3 lety +1

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

    • @light9808
      @light9808 Před 3 lety

      It shouldnt be. Works fine for me.

  • @philippurwoko
    @philippurwoko Před 3 lety

    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  Před 3 lety

      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.

  • @phantavius
    @phantavius Před 2 lety

    Do one for role management.

    • @ClarityCoders
      @ClarityCoders  Před 2 lety +1

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

    • @phantavius
      @phantavius Před 2 lety

      @@ClarityCoders appreciate it. :)

  • @LucasFromGuam
    @LucasFromGuam Před 2 lety

    what does the csv file look like in excel?

  • @Kaje376
    @Kaje376 Před 2 lety

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

  • @music-heart3121
    @music-heart3121 Před 2 lety +1

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

  • @epicone8953
    @epicone8953 Před 2 lety

    Do that video

  • @AnthonyWho
    @AnthonyWho Před 3 lety

    whats your discord server

  • @joshuasimmons571
    @joshuasimmons571 Před 2 lety

    instead of mentioning the user can you @ everyone??

  • @kn1gh1f1re
    @kn1gh1f1re Před 2 lety

    issue is there

  • @shaoliroy6469
    @shaoliroy6469 Před 2 lety

    bruh how do i get the csv file?

  • @masculine.brotherhood
    @masculine.brotherhood Před rokem +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.

  • @MasonJerman
    @MasonJerman Před 2 lety

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

    • @ClarityCoders
      @ClarityCoders  Před 2 lety +1

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

  • @Dope-to5pi
    @Dope-to5pi Před 3 lety

    It just shows the code

    • @ClarityCoders
      @ClarityCoders  Před 3 lety

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

  • @teceem
    @teceem Před rokem

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

  • @rip_jxofvrr
    @rip_jxofvrr Před 2 lety

    doesn't work

    • @ClarityCoders
      @ClarityCoders  Před 2 lety

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

  • @RonnieBlaze281
    @RonnieBlaze281 Před 3 lety

    replit deactivated your code already

  • @hanjiawang9507
    @hanjiawang9507 Před 3 lety

    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  Před 3 lety

      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 Před rokem

    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'