mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Clean up memegen code a bit
This commit is contained in:
parent
8238bdf6de
commit
f2b62c3ce7
4 changed files with 14 additions and 12 deletions
12
cogs/fun.py
12
cogs/fun.py
|
|
@ -94,22 +94,22 @@ class Fun(commands.Cog):
|
|||
result = memes.getMeme(name)
|
||||
|
||||
# No meme found
|
||||
if not result[0]:
|
||||
return await ctx.send(result[1])
|
||||
if result is None:
|
||||
return await ctx.send("Deze meme staat niet in de database.")
|
||||
|
||||
# Convert to list to support item assignment
|
||||
fields = list(fields)
|
||||
|
||||
# If there's only one field, the user isn't required to use quotes
|
||||
if result[1][2] == 1:
|
||||
if result[2] == 1:
|
||||
fields = [" ".join(fields)]
|
||||
|
||||
# Apply mock to mocking spongebob memes
|
||||
if result[1][1] == "mocking spongebob":
|
||||
if result[1] == "mocking spongebob":
|
||||
fields = list(map(mock.mock, fields))
|
||||
|
||||
# X, X everywhere only takes X as an argument
|
||||
if result[1][1] == "x, x everywhere":
|
||||
if result[1] == "x, x everywhere":
|
||||
fields[0] = " ".join(fields)
|
||||
fields.append(fields[0] + " everywhere")
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ class Fun(commands.Cog):
|
|||
|
||||
if req["success"]:
|
||||
caption = {
|
||||
"template_id": result[1][0],
|
||||
"template_id": result[0],
|
||||
"username": os.getenv("IMGFLIPNAME"),
|
||||
"password": os.getenv("IMGFLIPPASSWORD"),
|
||||
"boxes[0][text]": boxes[0]["text"],
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class ModCommands(commands.Cog):
|
|||
# Adds a meme into the database
|
||||
@add.command(name="Meme", aliases=["Mem"], usage="[Id] [Name] [Aantal Velden]")
|
||||
async def meme(self, ctx, memeid, meme, fields):
|
||||
await ctx.send(memes.insert(memeid, meme, fields)[1])
|
||||
await ctx.send(memes.insert(memeid, meme, fields))
|
||||
|
||||
# Adds a person's GitHub into the database
|
||||
@add.command(name="GitHub", aliases=["Gh", "Git"], usage="[Id] [Link]")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue