aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-31 18:59:36 +0300
committerGravatar ks123 <[email protected]>2020-03-31 18:59:36 +0300
commit44534b650d8d69e02e7fc8b0189e533cea037e25 (patch)
treeac338a8c8cdfaaa4e2b069501da06f86313e504c
parent(Tags): Moved to existing `wait_for_deletion` function instead using custom/n... (diff)
(Tags): Removed unnecessary `send_embed_with_trashcan` function due using existing function.
-rw-r--r--bot/cogs/tags.py24
1 files changed, 1 insertions, 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."""