aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/pause.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-11-28 00:41:33 -0600
committerParker <contact@pkrm.dev>2024-11-28 00:41:33 -0600
commite73db927c17866793293868d915bf0e37a906737 (patch)
treee05843e8e4af9b672731a435e8bd8a1f559bece9 /code/cogs/pause.py
parent1ce91a4b0984407bcd08b4fbf7448d7f4dbcead2 (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/pause.py')
-rw-r--r--code/cogs/pause.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/code/cogs/pause.py b/code/cogs/pause.py
index 2b7f98d..fb55aa4 100644
--- a/code/cogs/pause.py
+++ b/code/cogs/pause.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 Pause(commands.Cog):
@@ -18,20 +18,13 @@ class Pause(commands.Cog):
player = self.bot.lavalink.player_manager.get(interaction.guild.id)
await player.set_pause(pause=True)
- embed = discord.Embed(
+ embed = create_embed(
title=f"Music Now Paused ⏸️",
description=(
f"**[{player.current.title}]({player.current.uri})**\n\nQueued"
f" by: {player.current.requester.mention}"
),
- color=BOT_COLOR,
- )
- embed.set_thumbnail(url=player.current.artwork_url)
- embed.set_footer(
- text=datetime.datetime.now(datetime.timezone.utc).strftime(
- "%Y-%m-%d %H:%M:%S"
- )
- + " UTC"
+ thumbnail=player.current.artwork_url,
)
await interaction.response.send_message(embed=embed)