From 4befc7424339de881ea7823b91688d2c0762311a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20=C3=81lvarez?= Date: Thu, 20 Jul 2017 12:56:47 +0200 Subject: [PATCH] image and thumbnail embeds --- webhook.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/webhook.py b/webhook.py index ec95c6e..4660bab 100644 --- a/webhook.py +++ b/webhook.py @@ -41,6 +41,8 @@ def embed(**kwargs): "description": kwargs.get("description", None), "url": kwargs.get("url", None), "color": kwargs.get("color", None), + "image": kwargs.get("image", None), + "thumbnail": kwargs.get("thumbnail", None), "footer": kwargs.get("footer", None), "fields": kwargs.get("fields", []) } @@ -54,6 +56,22 @@ def field(name, value, inline=False): } +def image(url, w=50, h=50): + return { + "url": url, + "width": w, + "height": h + } + + +def thumbnail(url, w=50, h=50): + return { + "url": url, + "width": w, + "height": h + } + + def footer(text, icon_url): return { "text": text,