Customize number of memes in memedump
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tyler Perkins 2022-12-18 20:21:18 -05:00
parent 2a5a99065b
commit 56acadbc62
2 changed files with 11 additions and 3 deletions

View File

@ -271,7 +271,15 @@ async def memeCount(command, message, client):
# get a set of random memes # get a set of random memes
async def memeDump(command, message, client): async def memeDump(command, message, client):
await message.channel.send("Getting your memes...") await message.channel.send("Getting your memes...")
for i in range(0,5): count = 5
if len(command) > 1:
try:
count = int(command[1])
except:
print("Tried to parse a number, got (" + command[1] + ")")
count = 5
for i in range(0,count):
meme = getRandomMeme() meme = getRandomMeme()
ready_meme = getDiscordReadyObjectFromS3(meme) ready_meme = getDiscordReadyObjectFromS3(meme)
if isinstance(ready_meme, str): if isinstance(ready_meme, str):

View File

@ -10,8 +10,8 @@ async def showHelp(very, useless, arguments):
str += " Get a meme. Query for the exact name or search. Paramater is optional\n" str += " Get a meme. Query for the exact name or search. Paramater is optional\n"
str += "!memecount\n" str += "!memecount\n"
str += " Print total number of memes in the store\n" str += " Print total number of memes in the store\n"
str += "!memedump\n" str += "!memedump [COUNT]\n"
str += " Get 5 random memes\n" str += " Get COUNT random memes. If COUNT is not provided, we default to 5\n"
str += "!allmemes QUERY\n" str += "!allmemes QUERY\n"
str += " Get all memes that are like the given query\n" str += " Get all memes that are like the given query\n"
str += "!help\n" str += "!help\n"