Discord Python - Webhooks Send, Edit, Delete Messages

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 21

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

  • @reavzlololol
    @reavzlololol Před 11 měsíci +1

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

    • @MichaelKitas
      @MichaelKitas  Před 10 měsíci

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

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

      @@MichaelKitas thanks

  • @swworn
    @swworn Před rokem +1

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

    • @MichaelKitas
      @MichaelKitas  Před rokem

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

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

    how can I send views through a webhook

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

    So webhooks its kinda how we create discord bots ?

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

  • @narikodanhridul2845
    @narikodanhridul2845 Před rokem +1

    NameError: name 'Embed' is not defined

    • @MichaelKitas
      @MichaelKitas  Před rokem

      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

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

      What is colab?

    • @nova-man
      @nova-man Před 2 lety

      @@MichaelKitas the google colab, jupyter notebook.

  • @hakanayan8727
    @hakanayan8727 Před rokem +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  Před rokem

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

  • @porgl
    @porgl Před rokem +1

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