hacky but fail if they didnt provide a valid meme template

This commit is contained in:
Luke Robles 2024-07-03 10:59:50 -07:00
parent 81b2c25db7
commit 2b5facab40

View File

@ -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)