'Python discord-webhook

I have an error with webhook and I would not know how to solve it, this is the error that appears:

'str' object has no attribute 'add embed'

This is the part of the code that gives me an error

embed = DiscordEmbed(title="fortnite", description=f'# [{namelol}] Il pacchetto [{pak["dynamicPakId"]}] è stato decriptato!\nTrovato {len(files)} Cosmetico.\nAes ➡️ {aes.lower()}.')
                                webhook.add_embed(embed)
                                response = webhook.execute()


Solution 1:[1]

Are you sure you put your webhook in? It should be:

webhook = DiscordWebhook(url='your webhook url')

Based on the error, your webhook is only a string. If you did the code above it should work properly. Skimming through the docs showed me this, if it still doesn't work let me know.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user18478673