From 5dac10f2fd6719ec19ae6c5aeff581f152181735 Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Thu, 25 May 2023 19:56:21 +0300 Subject: [PATCH] [fix]: Demotivator fix --- cogs/fun.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cogs/fun.py b/cogs/fun.py index 1d5b848..d5764d0 100644 --- a/cogs/fun.py +++ b/cogs/fun.py @@ -9,6 +9,8 @@ from discord.ext import commands from os import remove from os.path import splitext, join +from simpledemotivators import Demotivator as Dem + tmp_dir = "tmp" class Fun(commands.Cog): @@ -61,15 +63,11 @@ class Fun(commands.Cog): @app_commands.command() async def demotivator(self, inter: discord.Interaction, title: str, text: str, image: discord.Attachment): - logger.debug((title, text)) - if not "image" in image.content_type: await inter.response.send_message("Это не изображение") return - logger.debug("Meow") filename = join("tmp", f"{inter.id}_{image.filename}") - logger.debug(filename) await image.save(filename) Dem(title, text).create(filename, font_name="FreeSans.ttf") with open('demresult.jpg', 'rb') as f: