hacky but fail if they didnt provide a valid meme template
All checks were successful
Build and push / changes (push) Successful in 23s
Build and push / Lint-Python (push) Successful in 7s
Build and push / Build-and-Push-Docker (push) Successful in 1m47s
Build and push / sync-argocd-app (push) Successful in 3s

This commit is contained in:
Luke Robles 2024-07-03 10:59:50 -07:00
parent 75c43689a3
commit b42cdf6f4d

View File

@ -205,9 +205,20 @@ class Cheeky(commands.Cog):
required=True, 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 import meme_gen
await ctx.defer()
await ctx.send_followup( await ctx.send_followup(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=meme_gen.parse_message(template, top, bottom) embed_url=meme_gen.parse_message(template, top, bottom)