Simple Discord Bot in Python

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • Today we learn how to code a simple Discord bot in Python.
    Get Tabnine Pro for 50% off here: www.tabnine.com/pricing/check...
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    💻 The Algorithm Bible Book: www.neuralnine.com/books/
    🐍 The Python Bible Book: www.neuralnine.com/books/
    👕 Programming Merch: www.neuralnine.com/shop
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine.com/
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/NeuralNine
    🎵 Outro Music From: www.bensound.com/
    Timestamps:
    (0:00) Intro
    (2:21) Setting Up Discord Bot
    (6:36) Installation & Authentication
    (10:16) Sending Basic Messages
    (14:18) Sending DMs
    (15:35) Sending Message On Connect
    (16:56) On Member Join
    (18:51) Stock Price Bot
    (25:51) Outro
  • Věda a technologie

Komentáře • 69

  • @benjamindreyer9884
    @benjamindreyer9884 Před 3 lety +2

    Your videos are so great! Would love to see another code wars video, you could make it a series :D

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

    Another usefull tutorial !
    I see that your pycharm is well customed, can you do an overview of the main plugins and themes you have ?
    Thanks again for all your videos !

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

    Nice video! Well explained :)

  • @carlparadis
    @carlparadis Před 2 lety

    well explained, thanks

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

    Can you show us how to add more things? i couldn't figure out

  • @21Mayhem
    @21Mayhem Před 2 lety +1

    for those who can't find Copy ID option you just need to turn on developer mode feature

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

    You're one of the reason I started my channel. Great content as always.
    Well explained and innovative.

  • @JoelsNoBS
    @JoelsNoBS Před 3 lety

    Awesome!

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

    YES, BEEN WAITING FOR THIS VIDEO! THANKS! neuralnine fire no cap

  • @vulcanolog0
    @vulcanolog0 Před 2 lety

    Great content thanks

  • @zachreitan3859
    @zachreitan3859 Před 2 lety

    I did exactly what your tutorial shows and i keep getting "RuntimeError: Event loop is closed"
    The discord dev portal has lots of poorly explained options. I don't understand what im doing wrong

  • @TomKnudsen
    @TomKnudsen Před 2 lety

    Two questions..
    1) How do I get the bot to be online all the time. Kinda seems like it just runs an event loop which closes when the program closes?
    2) Is there a bug in your code, keep getting this " File "c:\Users\post\Documents\Python Coding\TKBOT\tkbot.py", line 27, in on_connect
    await channel.send("Just connected to channel")
    AttributeError: 'NoneType' object has no attribute 'send'"

  • @vivekminj3836
    @vivekminj3836 Před 3 lety

    Thank you nice video

  • @fcode9310
    @fcode9310 Před 3 lety

    Yay!, thanks for this amazing video!. I hope we can get more in depth in the future. ;)

  • @phat5134
    @phat5134 Před 3 lety

    can i ask why im doing like you but i get error message

  • @samlolpip1604
    @samlolpip1604 Před 3 lety

    Yeaaaaa man pls do every part for discord bot thankssssssss fianly

  • @Robin-kh2nq
    @Robin-kh2nq Před 2 lety

    If any1 is having trouble copying the channel id you need to have dev mode enabled you can goto setting>advanced then check deveoper mode

  • @lolcraft2067
    @lolcraft2067 Před 3 lety

    this guy is really good

  • @abhinavchoudhary8014
    @abhinavchoudhary8014 Před 3 lety

    Great bro

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

    Your Are really Great :)

  • @alperkaya8919
    @alperkaya8919 Před 2 lety

    Thanks, I was able to leverage a bot from 0 within 15 munites

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

    @neuralnine Please make a video about backend tiktok clone, please my guy

  • @vivekminj3836
    @vivekminj3836 Před 3 lety

    Hi nerualnine if I disconnect my internet connection then my bot will go offline? Do I need to host my bot to keep bot online?

    • @matthias916
      @matthias916 Před 3 lety

      You need to keep your computer connected to internet for the bot to work, also if you turn off your pc the bot goes offline

  • @MaybeTarun
    @MaybeTarun Před 3 lety

    Oooh i wanted this so bad

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

    Ayyyy nice!!

  • @fsoky
    @fsoky Před 3 lety

    *Great* 💕

  • @user-ge9wd5tk7i
    @user-ge9wd5tk7i Před 2 lety

    This event loop is already running
    During handling of the above exception, another exception occurred:

  • @rishabhscodes
    @rishabhscodes Před 3 lety

    How do I actually host the bot ? I can't really have that running on my machine the whole time.

    • @matthias916
      @matthias916 Před 3 lety

      You have to either rent a server to run it on or have your computer run it 24/7

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

    Stonks

  • @SparePlayss
    @SparePlayss Před 3 lety

    can you also make video for Telegram bot in python too? ^^

  • @TheCidle
    @TheCidle Před 2 lety

    Can someone tell me why my code still tells me "no module named discord" after i pip install it?

  • @Swarmer150
    @Swarmer150 Před 2 lety

    " 'pip' is not recognized as a external or a internal command " how to fix?

  • @manojkumark3934
    @manojkumark3934 Před 3 lety

    plz make video on json

  • @zidanutomo326
    @zidanutomo326 Před 3 lety

    6:04 that's what a robot would say

  • @gtdt5666
    @gtdt5666 Před 3 lety

    nice

  • @neppie14.
    @neppie14. Před rokem

    Makes bot:
    Me: ok and now?

  • @prince2347x
    @prince2347x Před 3 lety +5

    Make a tutorial on Ursina or panda3d🥺

    • @ananthramvijayaraj4554
      @ananthramvijayaraj4554 Před 3 lety

      I’m pretty sure he may, coz Ursina is very easy and powerful

    • @yusiferzendric1489
      @yusiferzendric1489 Před 3 lety

      @@ananthramvijayaraj4554 he didn't have any interest in 3d cause he had said it in his previous videos

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

    Telegram bot next tutorial ?

  • @abelsherry9686
    @abelsherry9686 Před 3 lety

    Can u make video of telegram Bot

  • @bellabella-tv8zg
    @bellabella-tv8zg Před 3 lety +1

    Yey

  • @ethan7930
    @ethan7930 Před 3 lety

    saw this video just as i was coding a bot for my discord server... what are the odds?

    • @inx1819
      @inx1819 Před 3 lety

      google is spying on you

  • @prod.ot5
    @prod.ot5 Před 3 lety

    I was literally trying to relearn this yesterday

  • @HoriRecap
    @HoriRecap Před 2 lety

    it usually not online it offline

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

    Yo!!

  • @HimanshuSharma-yz5ij
    @HimanshuSharma-yz5ij Před 3 lety

    Can you please upload videos on deep learning algorithms like CNN's and RNN's .. bytheway love your content ❤️ you always bring something new ❤️

  • @hossamal-dinhassan9652

    ❤️

  • @HoriRecap
    @HoriRecap Před 2 lety

    client.run(TOKEN) didnt work

    • @alpw404
      @alpw404 Před rokem

      me too, did u solve?

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

    im not early but im here :)

  • @PythonicMind
    @PythonicMind Před rokem

    client = discord.Client()

    • @useless7497
      @useless7497 Před rokem

      Did you ever find a solution to this problem? I am having something similar.

    • @PythonicMind
      @PythonicMind Před rokem +1

      @@useless7497 No.

    • @alpw404
      @alpw404 Před rokem

      @@useless7497 here:
      client = discord.Client(intents=discord.Intents.default())

    • @Sahillll05
      @Sahillll05 Před rokem +1

      intents = discord.Intents.all()
      intents.members = True
      intents.message_content = True
      client = discord.Client(intents=intents)

  • @shivangrathore
    @shivangrathore Před 3 lety

    ah you must use discord.ext.commands otherwise newbies gonna use on_message 🤣

  • @AdoukaStalks
    @AdoukaStalks Před 2 lety

    u r doing it the hard way... try @client.command()

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

    for anybody having trouble with # Define your intents
    intents = discord.Intents.default()
    intents.typing = False # For example, you can customize the intents as needed
    # Create the Client instance with the intents
    client = discord.Client(intents=intents)
    With the new API update they changed how it works so replace "Client = discord.Client()" With
    # Define your intents
    intents = discord.Intents.default()
    intents.typing = False # For example, you can customize the intents as needed
    # Create the Client instance with the intents
    client = discord.Client(intents=intents)
    # Rest of your code