diff options
author | Parker <contact@pkrm.dev> | 2024-11-28 00:41:33 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-28 00:41:33 -0600 |
commit | e73db927c17866793293868d915bf0e37a906737 (patch) | |
tree | e05843e8e4af9b672731a435e8bd8a1f559bece9 /code/cogs/clear.py | |
parent | 1ce91a4b0984407bcd08b4fbf7448d7f4dbcead2 (diff) |
Create `create_embed` template to replace `discord.Embed()`
- Auto-set color to BOT_COLOR
- Set footer to timestamp (overridden is timestamp is passed)
- Optional thumbnail
Diffstat (limited to 'code/cogs/clear.py')
-rw-r--r-- | code/cogs/clear.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/code/cogs/clear.py b/code/cogs/clear.py index 0d378ee..8e61b53 100644 --- a/code/cogs/clear.py +++ b/code/cogs/clear.py @@ -4,7 +4,7 @@ from discord import app_commands from discord.ext import commands from cogs.music import Music -from utils.config import BOT_COLOR +from utils.config import create_embed class Clear(commands.Cog): @@ -18,19 +18,13 @@ class Clear(commands.Cog): player = self.bot.lavalink.player_manager.get(interaction.guild.id) player.queue.clear() - embed = discord.Embed( + + embed = create_embed( title="Queue Cleared", description=( "The queue has been cleared of all songs!\n\nIssued by:" f" {interaction.user.mention}" ), - color=BOT_COLOR, - ) - embed.set_footer( - text=datetime.datetime.now(datetime.timezone.utc).strftime( - "%Y-%m-%d %H:%M:%S" - ) - + " UTC" ) await interaction.response.send_message(embed=embed) |