Created
March 11, 2024 12:11
-
-
Save damiancastelao/01215d12e686cd1208efc7f1afdea8de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importamos las librerias necesarias | |
from discord_webhook import DiscordWebhook, DiscordEmbed | |
import json | |
import requests | |
# Creamos el webhook y el embed, sustituyendo el enlace al webhook por el que hayamos creado en Discord | |
webhook = DiscordWebhook(url="enlace al webhook") | |
# Creamos el embed | |
embed = DiscordEmbed( | |
# titulo, descripcion y color del embed | |
title="Taco Love", | |
description="Tu taquito ya está!", | |
color="03b2f8") | |
# Añadimos la imagen del taco al mensaje | |
embed.set_image(url="https://cdn.dribbble.com/users/545781/screenshots/3157610/happy-taco.jpg") | |
# Añadimos el embed al webhook | |
webhook.add_embed(embed) | |
# Ejecutamos el webhook, enviando el mensaje a Discord | |
webhook.execute() | |
def lambda_handler(event, context): | |
# TODO implement | |
return { | |
'statusCode': 200, | |
'body': json.dumps('Hello from Discord Lambda!') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment