#πŸ”’ discord webhook not pinging

13 messages Β· Page 1 of 1 (latest)

fair jungle
#

i get unknown user for the content

                        content = "@distant void"
                        embed = {
                            "title": f"Restock! [{self.target_urls.index(url)}]",
                            "description": (
                                "Click the link below"
                                f"[Restock, Click Here]({redirected_url})"
                            ),
                        }
                        payload = {"embeds": [embed], "content": content, "allowed_mentions": {"roles": ["1317904702561849424"]}}
                        webhook_response = requests.post(self.discord_webhook, json=payload)```
fallen berryBOT
#

@fair jungle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

chrome crane
fair jungle
chrome crane
#

discord.py is literally a wrapper for discord's api

#

it's supposed to handle this stuff for you

#
await ctx.send(
    "<@some_mention>",
    embed = Embed(
        ...
    ),
    allowed_mentions = AllowedMentions(...)
)
fair jungle
chrome crane
fallen berryBOT
#

class discord.Webhook```
Represents an asynchronous Discord webhook.

Webhooks are a form to send messages to channels in Discord without a bot user or authentication.

There are two main ways to use Webhooks. The first is through the ones received by the library such as [`Guild.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.webhooks), [`TextChannel.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.webhooks), [`VoiceChannel.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.VoiceChannel.webhooks) and [`ForumChannel.webhooks()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.ForumChannel.webhooks). The ones received by the library will automatically be bound using the library’s internal HTTP session.

The second form involves creating a webhook object manually using the [`from_url()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Webhook.from_url) or [`partial()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Webhook.partial) classmethods.

For example, creating a webhook from a URL and using [aiohttp](https://docs.aiohttp.org/en/stable/index.html):
fallen berryBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.