diff --git a/assets/trumpfooter.png b/assets/trumpfooter.png deleted file mode 100644 index 4e81e34..0000000 Binary files a/assets/trumpfooter.png and /dev/null differ diff --git a/assets/trumpheader.png b/assets/trumpheader.png deleted file mode 100644 index 34efe9e..0000000 Binary files a/assets/trumpheader.png and /dev/null differ diff --git a/cogs/imagemanip.py b/cogs/imagemanip.py index 031e82c..abf4412 100644 --- a/cogs/imagemanip.py +++ b/cogs/imagemanip.py @@ -77,69 +77,6 @@ class ImageManip(Cog): await ctx.send(content=f"{mention}: Enjoy.", file=discord.File(out_filename)) - @commands.check(check_if_staff_or_ot) - @commands.command(hidden=True) - async def trump(self, ctx, *, headline: str): - """Gives a trump tweet""" - mention = ctx.author.mention - - in_header = "assets/trumpheader.png" - in_footer = "assets/trumpfooter.png" - font_path = "assets/Segoe UI.ttf" - - # Settings for image generation, don't touch anything - horipos = 10 - vertpos = 70 - font_size = 27 - image_width = 590 - font_wrap_count = 45 - sig_height = 49 - - # Wrap into lines - lines = textwrap.wrap(headline, width=font_wrap_count) - # not great, 4am be like - image_height = (len(lines) + 2) * vertpos - - # Load font - f = PIL.ImageFont.truetype(font_path, font_size) - - # Create image base, paste mobo logo - im = PIL.Image.new("RGB", (image_width, image_height), color="#15202B") - headerim = PIL.Image.open(in_header) - im.paste(headerim, (horipos, 15)) - - # Go through all the wrapped text lines - for line in lines: - # Get size of the text by font, create a new image of that size - size = f.getsize(line) - txt = PIL.Image.new('L', size) - - # Draw the text - d = PIL.ImageDraw.Draw(txt) - d.text((0, 0), line, font=f, fill=255) - - # Paste the text into the base image - w = txt.rotate(0, expand=1) - im.paste(PIL.ImageOps.colorize(w, (0, 0, 0), - (255, 255, 255)), (horipos, vertpos), - w) - - # Calculate position on next line - vertpos += size[1] - - # Add jcox signature - jcoxim = PIL.Image.open(in_footer) - im.paste(jcoxim, (horipos, vertpos + int(sig_height / 3))) - - # Crop the image to the actual resulting size - im = im.crop((0, 0, image_width, vertpos + int(sig_height * 2.5))) - - # Save image - out_filename = f"/tmp/{ctx.message.id}-out.png" - im.save(out_filename, quality=100, optimize=True) - await ctx.send(content=f"{mention}: Enjoy.", - file=discord.File(out_filename)) - def setup(bot): bot.add_cog(ImageManip(bot))