From 2b5facab406ce2d8f8c7a15356d2a08b937facfa Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Wed, 3 Jul 2024 10:59:50 -0700 Subject: [PATCH] hacky but fail if they didnt provide a valid meme template --- app/cogs/cheeky_functions.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/cogs/cheeky_functions.py b/app/cogs/cheeky_functions.py index 4c15629a..ad280c3d 100755 --- a/app/cogs/cheeky_functions.py +++ b/app/cogs/cheeky_functions.py @@ -205,9 +205,20 @@ class Cheeky(commands.Cog): required=True, ), ): + + if template not in sorted( + list( + map( + lambda x: x["id"], + requests.get("https://api.memegen.link/templates/").json(), + ) + ) + ): + await ctx.respond("❌ You didnt pick a valid meme template ❌") + return + await ctx.defer() import meme_gen - await ctx.defer() await ctx.send_followup( embed=core_utils.generate_embed( embed_url=meme_gen.parse_message(template, top, bottom)