|
|
@@ -7,12 +7,13 @@ async def delete_option(bot, ctx, message, delete_emoji, timeout=20): |
|
|
|
await message.add_reaction(delete_emoji) |
|
|
|
|
|
|
|
def check(r, u): |
|
|
|
return str(r) == str(delete_emoji) and u == ctx.author |
|
|
|
return str(r) == str(delete_emoji) and u == ctx.author and r.message == message |
|
|
|
|
|
|
|
try: |
|
|
|
await bot.wait_for("reaction_add", timeout=timeout, check=check) |
|
|
|
await message.delete() |
|
|
|
return await ctx.send("{} requested output be deleted.".format(ctx.author)) |
|
|
|
await message.remove_reaction(delete_emoji, bot.user) |
|
|
|
await message.remove_reaction(delete_emoji, ctx.author) |
|
|
|
return await message.edit(content="{} requested output be deleted.".format(ctx.author)) |
|
|
|
except TimeoutError: |
|
|
|
await message.remove_reaction(delete_emoji, bot.user) |
|
|
|
|