Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature DiscordEmbed.from_dict(embed_json) #145

Open
empereira opened this issue Dec 2, 2023 · 0 comments
Open

Feature DiscordEmbed.from_dict(embed_json) #145

empereira opened this issue Dec 2, 2023 · 0 comments

Comments

@empereira
Copy link

hi,

It would be very interesting if you could create a feature to load a json, as in the example:

DiscordEmbed.from_dict(embed_json)

def send_discord_message(webhook_url, embed_json):
    try:
        webhook = DiscordWebhook(url=webhook_url)
        embed = DiscordEmbed.from_dict(embed_json)
        webhook.add_embed(embed)
        webhook.execute()
        print(f"Mensagem enviada via webhook:\n{embed_json}")
    except Exception as e:
        print(f"Erro ao enviar mensagem via webhook: {e}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant