From e73db927c17866793293868d915bf0e37a906737 Mon Sep 17 00:00:00 2001 From: Parker Date: Thu, 28 Nov 2024 00:41:33 -0600 Subject: 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 --- code/cogs/stop.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'code/cogs/stop.py') diff --git a/code/cogs/stop.py b/code/cogs/stop.py index 3992391..5d1f148 100644 --- a/code/cogs/stop.py +++ b/code/cogs/stop.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 Stop(commands.Cog): @@ -25,19 +25,12 @@ class Stop(commands.Cog): await player.stop() await interaction.guild.voice_client.disconnect(force=True) - embed = discord.Embed( + embed = create_embed( title="Queue Cleared and Music Stopped", description=( "Thank you for using me :wave:\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) -- cgit v1.2.3-70-g09d2