From a545af54cf797f8cb9b91f7338319f33b917c939 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sat, 25 May 2024 20:08:06 +0200 Subject: [PATCH] disable seafile image preview --- bot.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bot.py b/bot.py index 41bf62c..fb9771b 100644 --- a/bot.py +++ b/bot.py @@ -56,13 +56,14 @@ class CustomClient(discord.Client): f"https://stream.purser.it/{stripped}/?provider=seafile&raw=true", allow_redirects=True, ) - raw = str( - (ctype := resp.headers.get("content-type")) and "image" in ctype - ).lower() - - await message.reply( - content=f"https://stream.purser.it/{stripped}/?provider=seafile&raw={raw}" - ) + if (ctype := resp.headers.get("content-type")) and "image" in ctype: + await message.reply( + content=f"" + ) + else: + await message.reply( + content=f"https://stream.purser.it/{stripped}/?provider=seafile&raw=false" + ) elif "twitch" in url.hostname: stripped = url.path.strip("/")