diff --git a/src/memes.py b/src/memes.py index 569ec3a..7a9ca76 100644 --- a/src/memes.py +++ b/src/memes.py @@ -348,10 +348,16 @@ async def uploadMeme(command, message, discordClient): return "Thanks got your memes!" async def memeBlame(command, message, discordClient): + query_string = "" if len(command) <= 1: - return "I need a file name or query!" + if message.reference is not None: # this is a reply blame + m = await message.channel.fetch_message(message.reference.message_id) + if m.attachments is not None and len(m.attachments) > 0: + query_string = m.attachments[0].filename + else: return "No file attached to replied message!" + else: return "I need a file name or query!" + else: query_string = ' '.join(command[1:]) #get QUERY_STRING - query_string = ' '.join(command[1:]) #get QUERY_STRING return_string = "" all_memes = getCurrentMemeList() @@ -365,5 +371,3 @@ async def memeBlame(command, message, discordClient): return_string += "uploaded by " + author return return_string - -