aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/shuffle.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/shuffle.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/shuffle.py')
-rw-r--r--code/cogs/shuffle.py28
1 files changed, 7 insertions, 21 deletions
diff --git a/code/cogs/shuffle.py b/code/cogs/shuffle.py
index 5c2f381..78213d6 100644
--- a/code/cogs/shuffle.py
+++ b/code/cogs/shuffle.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 Shuffle(commands.GroupCog, name="shuffle"):
@@ -19,16 +19,9 @@ class Shuffle(commands.GroupCog, name="shuffle"):
player.shuffle = True
- embed = discord.Embed(
- title=f"Shuffle Enabled 🔀",
- description=f"All music will now be shuffled.",
- color=BOT_COLOR,
- )
- embed.set_footer(
- text=datetime.datetime.now(datetime.timezone.utc).strftime(
- "%Y-%m-%d %H:%M:%S"
- )
- + " UTC"
+ embed = create_embed(
+ title="Shuffle Enabled 🔀",
+ description="All music will now be shuffled.",
)
await interaction.response.send_message(embed=embed)
@@ -40,16 +33,9 @@ class Shuffle(commands.GroupCog, name="shuffle"):
player.shuffle = False
- embed = discord.Embed(
- title=f"Disabled 🔀",
- description=f"Music will no longer be shuffled.",
- color=BOT_COLOR,
- )
- embed.set_footer(
- text=datetime.datetime.now(datetime.timezone.utc).strftime(
- "%Y-%m-%d %H:%M:%S"
- )
- + " UTC"
+ embed = create_embed(
+ title="Shuffle Disabled 🔀",
+ description="Music will no longer be shuffled.",
)
await interaction.response.send_message(embed=embed)