From 44534b650d8d69e02e7fc8b0189e533cea037e25 Mon Sep 17 00:00:00 2001 From: ks123 Date: Tue, 31 Mar 2020 18:59:36 +0300 Subject: (Tags): Removed unnecessary `send_embed_with_trashcan` function due using existing function. --- bot/cogs/tags.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/bot/cogs/tags.py b/bot/cogs/tags.py index 3da05679e..a6e5952ff 100644 --- a/bot/cogs/tags.py +++ b/bot/cogs/tags.py @@ -1,16 +1,14 @@ -import asyncio import logging import re import time from pathlib import Path from typing import Callable, Dict, Iterable, List, Optional -from discord import Colour, Embed, Reaction, User +from discord import Colour, Embed from discord.ext.commands import Cog, Context, group from bot import constants from bot.bot import Bot -from bot.constants import Emojis from bot.converters import TagNameConverter from bot.pagination import LinePaginator from bot.utils.messages import wait_for_deletion @@ -142,26 +140,6 @@ class Tags(Cog): max_lines=15 ) - async def send_embed_with_trashcan(self, ctx: Context, embed: Embed) -> None: - """Send embed and handle it's and command message deletion with `trashcan` emoji.""" - msg = await ctx.send(embed=embed) - await msg.add_reaction(Emojis.trashcan) - - def check_trashcan(reaction: Reaction, user: User) -> bool: - return ( - reaction.emoji == Emojis.trashcan - and user == ctx.author - and reaction.message.id == msg.id - ) - - try: - await self.bot.wait_for("reaction_add", timeout=60.0, check=check_trashcan) - except asyncio.TimeoutError: - await msg.remove_reaction(Emojis.trashcan, msg.author) - else: - await ctx.message.delete() - await msg.delete() - @group(name='tags', aliases=('tag', 't'), invoke_without_command=True) async def tags_group(self, ctx: Context, *, tag_name: TagNameConverter = None) -> None: """Show all known tags, a single tag, or run a subcommand.""" -- cgit v1.2.3