aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/queue.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/queue.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/queue.py')
-rw-r--r--code/cogs/queue.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/code/cogs/queue.py b/code/cogs/queue.py
index d11a4a9..faaed60 100644
--- a/code/cogs/queue.py
+++ b/code/cogs/queue.py
@@ -6,7 +6,7 @@ from cogs.music import Music
import math
import lavalink
-from utils.config import BOT_COLOR
+from utils.config import create_embed
class Queue(commands.Cog):
@@ -23,19 +23,12 @@ class Queue(commands.Cog):
player = self.bot.lavalink.player_manager.get(interaction.guild.id)
if not player.queue:
- embed = discord.Embed(
+ embed = create_embed(
title="Nothing Queued",
description=(
"Nothing is currently in the queue, add a song with the"
" </play:1224840890368000172> command."
),
- color=BOT_COLOR,
- )
- embed.set_footer(
- text=datetime.datetime.now(datetime.timezone.utc).strftime(
- "%Y-%m-%d %H:%M:%S"
- )
- + " UTC"
)
return await interaction.response.send_message(
embed=embed, ephemeral=True
@@ -60,14 +53,13 @@ class Queue(commands.Cog):
f" {track.author} `({track_duration})`\n"
)
- embed = discord.Embed(
+ embed = create_embed(
title=f"Queue for {interaction.guild.name}",
description=(
f"**{len(player.queue)} tracks total**\n\n{queue_list}"
),
- color=BOT_COLOR,
+ footer=f"Viewing page {page}/{pages}",
)
- embed.set_footer(text=f"Viewing page {page}/{pages}")
await interaction.response.send_message(embed=embed)