Discord Python - Webhooks Send, Edit, Delete Messages

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2024

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

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

    Thanks for watching the video! What should I make a tutorial on next? Don't forget to join our discord server: discord.gg/mYCBHTZm6v

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

    hey man i dont understand how safe it is or how to download the discord module etc.

    • @MichaelKitas
      @MichaelKitas  ปีที่แล้ว

      It’s safe, though I recommend you watch a Nodejs or JavaScript tutorial first so you get familiar with programming

  • @Pearl115
    @Pearl115 2 ปีที่แล้ว +1

    it says "line 2, in
    from discord import Webhook, AsyncWebhookAdapter
    ImportError: cannot import name 'AsyncWebhookAdapter' from 'discord' " but i installed discord module

    • @MichaelKitas
      @MichaelKitas  2 ปีที่แล้ว +1

      With the new release of discord package, you have to update your code to:
      import requests
      from discord import SyncWebhook # Import SyncWebhook
      webhook = SyncWebhook.from_url('discord.com/api/webhooks/[my-webhook]') # Initializing webhook
      webhook.send(content="Hello World") # Executing webhook.

    • @Pearl115
      @Pearl115 2 ปีที่แล้ว +1

      @@MichaelKitas thanks

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

    i dont get any error codes but it doesnt say anything why?

    • @MichaelKitas
      @MichaelKitas  ปีที่แล้ว

      Can't tell, would need to review your code.

  • @nova-man
    @nova-man 2 ปีที่แล้ว +1

    just found your channel. very nice video tutorials, thank you
    i was watching selenium series.
    had a idea to use chrome selenium in colab but it does not work for some reason,
    if you have time can you try make it work in colab. (possible video idea)
    thanks, have good day

    • @MichaelKitas
      @MichaelKitas  2 ปีที่แล้ว

      What is colab?

    • @nova-man
      @nova-man 2 ปีที่แล้ว

      @@MichaelKitas the google colab, jupyter notebook.

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

    it says after i cliick the play button,
    Traceback (most recent call last):
    File "c:\Users\Hakan\Desktop\Phyton Webhooks\main.py", line 1, in
    import requests
    ModuleNotFoundError: No module named 'requests'

    • @MichaelKitas
      @MichaelKitas  ปีที่แล้ว

      You need to install the module requests by running in the command line: "pip install requests"

  • @ramzbew5674
    @ramzbew5674 2 ปีที่แล้ว +1

    So webhooks its kinda how we create discord bots ?

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

      A webhook is a URL. You (or anyone else that knows the URL) can make a POST request to that URL and then Discord will send the contents of that request as a message in the webhook's channel. This is all that webhooks can do. They can do nothing else except send a message in one specific channel. Webhooks are not restricted by permissions; making a valid request to the hook will always result in a message, there's no way to prevent that.
      Bots are actual users in Discord, more or less the same as human users. They join your server and then show up in the server's member list. Bots have access to Discord's entire API and can do basically the same things a human can do. Meaning they can send/read/delete/pin messages, create/delete/assign roles, create/delete/edit channels, kick/ban members, e.t.c. They are subject to the same permission system as normal users, so you can use permissions to regulate what a specific bot is allowed to do.
      Source: www.reddit.com/r/discordapp/comments/b1uc7y/difference_between_webhooks_and_bots/

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

    import requests
    from discord import Webhook, RequestWebhookAdapter
    webhook = Webhook.partial(123456, 'abcdefg', adapter=RequestWebhookAdapter())
    webhook.send('Hello World', username='Foo')

  • @sorrym8958
    @sorrym8958 7 หลายเดือนก่อน

    how can I send views through a webhook

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

    NameError: name 'Embed' is not defined

    • @MichaelKitas
      @MichaelKitas  ปีที่แล้ว

      You need to use same discord version as me otherwise you need to visit documentation again as they have made updates and some of the methods I showed work differently now