aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-31 18:57:28 +0300
committerGravatar ks123 <[email protected]>2020-03-31 18:57:28 +0300
commit315ffa747c1e5b4527dce07061a3e0016eea7e5f (patch)
treea761db8f64b97712aef1b56dd04e53c71cf08a13
parent(Tags): Added blank line between check function and `try:` block on `send_emb... (diff)
(Tags): Moved to existing `wait_for_deletion` function instead using custom/new one.
-rw-r--r--bot/cogs/tags.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/bot/cogs/tags.py b/bot/cogs/tags.py
index 8115423cc..3da05679e 100644
--- a/bot/cogs/tags.py
+++ b/bot/cogs/tags.py
@@ -13,6 +13,7 @@ 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
log = logging.getLogger(__name__)
@@ -189,6 +190,7 @@ class Tags(Cog):
@tags_group.command(name='get', aliases=('show', 'g'))
async def get_command(self, ctx: Context, *, tag_name: TagNameConverter = None) -> None:
"""Get a specified tag, or a list of all tags if no tag is specified."""
+
def _command_on_cooldown(tag_name: str) -> bool:
"""
Check if the command is currently on cooldown, on a per-tag, per-channel basis.
@@ -227,12 +229,22 @@ class Tags(Cog):
"time": time.time(),
"channel": ctx.channel.id
}
- await self.send_embed_with_trashcan(ctx, Embed.from_dict(tag['embed']))
+ await wait_for_deletion(
+ await ctx.send(embed=Embed.from_dict(tag['embed'])),
+ [ctx.author.id],
+ client=self.bot
+ )
elif founds and len(tag_name) >= 3:
- await self.send_embed_with_trashcan(ctx, Embed(
- title='Did you mean ...',
- description='\n'.join(tag['title'] for tag in founds[:10])
- ))
+ await wait_for_deletion(
+ await ctx.send(
+ embed=Embed(
+ title='Did you mean ...',
+ description='\n'.join(tag['title'] for tag in founds[:10])
+ )
+ ),
+ [ctx.author.id],
+ client=self.bot
+ )
else:
tags = self._cache.values()