(2020) How to Code Your Own Discord Bot in Python #2 - Intro to Events!

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ม.ค. 2025

ความคิดเห็น • 57

  • @ivansalvrubino
    @ivansalvrubino 4 ปีที่แล้ว +27

    Hey Ajay!
    Keep on doing this great job, I'm learning a lot.
    This is one of the only places I found updated tutorial for discord bots.

  • @Alirezarz62
    @Alirezarz62 4 ปีที่แล้ว +5

    I don't usually comment but man you are so good at teaching and explaining stuff! Mad respect my dude, Subbed and liked!

  • @aryanpunjabi5035
    @aryanpunjabi5035 4 ปีที่แล้ว +5

    Thank you so much! I've been wanting to try this for ages!

  • @melk01
    @melk01 4 ปีที่แล้ว +3

    THANK YOU AJAY THIS IS EXCATLY WHAT I NEREDED

  • @infintiyward
    @infintiyward 3 ปีที่แล้ว +1

    You are a great teacher. You review import concepts which a lot of youtuber teachers neglect to do

  • @iamzareef
    @iamzareef 3 ปีที่แล้ว +1

    This guy is very underrated

  • @MrKrisJ
    @MrKrisJ 4 ปีที่แล้ว

    woah..ur the first person who's code actually works and thx for the link of the documentation! Love from india

  • @lawesosah9214
    @lawesosah9214 4 ปีที่แล้ว +1

    Excellent explanations Ajay!

  • @jorgeenriquezm
    @jorgeenriquezm 4 ปีที่แล้ว +1

    Thank you for the series Ajay, such a great work.
    Just a quick question I´m not finding any docs for... how can you listen all the channels (or at least several channels)? I mean, is there a way to let the bot check for those command on more than one channel? I´m gonna keep searching for, but if you have any comment about this, just let me know. Thanks again.

  • @TirthTheDev
    @TirthTheDev 3 ปีที่แล้ว

    No video can be better than this video

  • @susmitamaity9096
    @susmitamaity9096 3 ปีที่แล้ว +2

    You told that you will provide the links but I think you totally forgot about it. By the way, you teach very nicely and I am loving this series.

  • @kingfred9
    @kingfred9 3 ปีที่แล้ว +1

    You are so helpful! Thank you so much!

  • @shayanlalani3928
    @shayanlalani3928 4 ปีที่แล้ว +2

    is there a way to make it send in all channels of a server not just one like if the keyword is triggered in channel a it will respond in channel and if the keyword is triggered in channel b it will respond in channel b it wont just respond in one channel for all messages

  • @light-owo
    @light-owo 4 ปีที่แล้ว +1

    good tutorial !! I'm waiting for the nexts

  • @udpskid
    @udpskid 3 ปีที่แล้ว +2

    ajay god

  • @fatetastarossa
    @fatetastarossa 4 ปีที่แล้ว

    I want to try to make my own bot. Your video is so great for the beginner like me! Thank you for such a detail explanation!

  • @magicomgmustwatch9133
    @magicomgmustwatch9133 3 ปีที่แล้ว +1

    It says .send is not found

  • @ugulsen6216
    @ugulsen6216 4 ปีที่แล้ว +1

    heyy my bot doesnt work when i say the message
    it doesnt reply

  • @CrannedBerries
    @CrannedBerries 4 ปีที่แล้ว +1

    how do i make the commands accesible in any channel?

  • @thescore91
    @thescore91 3 ปีที่แล้ว

    Your channel helpful so much. good videos

  • @eshaambhattad888
    @eshaambhattad888 4 ปีที่แล้ว +1

    Anyone know why async def is being syntax errored?

  • @kwamenadadson
    @kwamenadadson 4 ปีที่แล้ว

    This is what I was actually looking for thanks

  • @smign5975
    @smign5975 4 ปีที่แล้ว +1

    how to make discord bot that gives roles when you join voice channel and removes when left !

  • @mathiskirchner
    @mathiskirchner 4 ปีที่แล้ว

    Great Videos!

  • @ugulsen6216
    @ugulsen6216 4 ปีที่แล้ว

    love the series sir

  • @theleetpanda360
    @theleetpanda360 4 ปีที่แล้ว

    hi, really liking the tutorial so far : ) Very useful.
    I'm trying to make it so my bot will delete messages in most channels that have a certain ping (an @role) also message the sender with a warning
    and deleted chatter in specific channels that are designated for those pings
    Is this possible? I've seen a couple other big servers that have bots that do this, I'm just not sure how they did it

  • @coderttpo2
    @coderttpo2 4 ปีที่แล้ว

    THANK U SO MUCH DUDE! :)

  • @masonburke7756
    @masonburke7756 4 ปีที่แล้ว +1

    I'm new to python and when I ran the first program i got a bunch of errors containing links to a python file that i didn't write. I'm sorry that I sound like a noob but can someone pls help?

  • @stormgamesyt
    @stormgamesyt 4 ปีที่แล้ว +2

    E, I was doing message == "Hello", but not message.content == "Hello"
    Half an hour until I realiesed

  • @ablindworm1780
    @ablindworm1780 4 ปีที่แล้ว

    Best Ytuber

  • @thesouledguitarist7144
    @thesouledguitarist7144 4 ปีที่แล้ว

    Whenever I try to run the first hello command it doesn't show the async in blue and the on ready is just treated as the normal text is there any way I can fix this problem

  • @tamimsarker828
    @tamimsarker828 4 ปีที่แล้ว +1

    I keep getting this error.
    AttributeError: 'NoneType' object has no attribute 'send'

    • @zerokun2655
      @zerokun2655 4 ปีที่แล้ว

      I got it too, that means it couldn't find the channel u were looking for in "general_channel = client.get_channel([Integer])".. And that variable is then empty.. Check the integer is right and also, if you use some external bot(like Yui) to like clear the messages of the all channel (nuke for yui) make sure that after nuking you check the id again.. Also, for the on_message instead of sending to general_channel and needing the id every time, you can use message.channel and it will get the channel the message was written into.. To send something there use "await message.channel.send(" Hello") and it will send text to the channel was sent into

    • @dkdjdw305
      @dkdjdw305 4 ปีที่แล้ว +1

      get rid of ' or " mark and it will work because it consdried it a string

  • @frozvial237
    @frozvial237 4 ปีที่แล้ว

    why do you sensor your username but in the middle you not.

  • @redrum_4.776
    @redrum_4.776 4 ปีที่แล้ว

    how would I make it so no mater how they type it in, the message.content is modified to all lower case or all upper case? example "What is the Version" or "what is the VERSION" gets changed before the if statement to "what is the version"?

  • @itz_mune
    @itz_mune 4 ปีที่แล้ว

    plz help, it shows me an unexpected intend error on await although I did the same intend as you!!

  • @vijaynariyal9818
    @vijaynariyal9818 4 ปีที่แล้ว

    my @on_message is trigger too many tines i am cannot handle this help me

  • @elgenestudio8698
    @elgenestudio8698 4 ปีที่แล้ว +1

    When i run my bot it only reacts to one event so one of my commands is ?version and the other is ?modcontent and the bot only responds to ?version and ignores ?modcontent

    • @coolderp1051
      @coolderp1051 4 ปีที่แล้ว +1

      Same here, One command works, and one doesn't.

  • @barneyswiftjaguar3363
    @barneyswiftjaguar3363 4 ปีที่แล้ว

    When I run my bot, I get this error: AttributeError: 'NoneType' object has no attribute 'send'

    • @66metal666head66
      @66metal666head66 4 ปีที่แล้ว

      yeah I had this issue as well...turns out I fat fingered the last digit of the channel ID lol

    • @sigmathletics
      @sigmathletics 4 ปีที่แล้ว

      Did you put await before general_channel.send?

    • @sigmathletics
      @sigmathletics 4 ปีที่แล้ว

      At least that’s how I fixed it after I forgot to put it

  • @nishalahmed
    @nishalahmed 4 ปีที่แล้ว

    you cant use
    async def on_message(message):
    two times pls help

    • @kappaZ64
      @kappaZ64 4 ปีที่แล้ว

      add an if statement within the same function

  • @soul7247
    @soul7247 4 ปีที่แล้ว

    thank u ur getting a sub

  • @mrolivernone4040
    @mrolivernone4040 4 ปีที่แล้ว

    guys i need help i don use client i use @bot.event
    this code does not say error but it also does not do anything
    @bot.event
    async def on_message(message):
    if message == "hello":
    general_channel = bot.get_channel(id)#question: what id is this exactly
    await ctx.send("Hola")
    i took off general_channel = bot.get_channel(id) and it also did not work it just does nor run

    • @oreofreakshake
      @oreofreakshake 4 ปีที่แล้ว

      bot.get_channel(id)
      #write the channel ID between the brackets instead of id

  • @bhorotsoubam7539
    @bhorotsoubam7539 4 ปีที่แล้ว

    I found this Error
    Traceback(most recent call last):
    File "C:\ProgramData\Anaconda3\lib\site-pakages\discord\client.py", line 333,
    in _run_event
    await coro(*args, **kwargs)
    File "new.py", line 15, in on_message
    if message.content == 'hello':
    NameError: name 'message' is not defined
    Ignoring exception in on_message
    File "C:\ProgramData\Anaconda3\lib\site-pakages\discord\client.py", line 333,
    in _run_event
    await coro(*args, **kwargs)
    File "new.py", line 15, in on_message
    if message.content == 'hello':
    NameError: name 'message' is not defined
    Anyone any suggestions please.

  • @mastertoad2
    @mastertoad2 4 ปีที่แล้ว +1

    damn ur a highschooler thats impressive

  • @uiopler3179
    @uiopler3179 3 ปีที่แล้ว +1

    im comment #69 pog :o

  • @spectaculararray6309
    @spectaculararray6309 4 ปีที่แล้ว

    :))

  • @terrafunny8627
    @terrafunny8627 4 ปีที่แล้ว +1

    #NotificationGang

  • @soul7247
    @soul7247 4 ปีที่แล้ว

    .