aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/autoplay.py
diff options
context:
space:
mode:
Diffstat (limited to 'code/cogs/autoplay.py')
-rw-r--r--code/cogs/autoplay.py32
1 files changed, 7 insertions, 25 deletions
diff --git a/code/cogs/autoplay.py b/code/cogs/autoplay.py
index 4b2f624..5c2ec29 100644
--- a/code/cogs/autoplay.py
+++ b/code/cogs/autoplay.py
@@ -6,7 +6,7 @@ from cogs.music import Music
from typing import Literal
from utils.ai_recommendations import add_song_recommendations
-from utils.config import BOT_COLOR
+from utils.config import create_embed
class Autoplay(commands.Cog):
@@ -23,28 +23,26 @@ class Autoplay(commands.Cog):
if toggle == "OFF":
self.bot.autoplay.remove(interaction.guild.id)
- embed = discord.Embed(
+ embed = create_embed(
title="Autoplay Off",
description=(
"Autoplay has been turned off. I will no longer"
" automatically add new songs to the queue based on AI"
" recommendations."
),
- color=BOT_COLOR,
)
return await interaction.response.send_message(embed=embed)
# Otherwise, toggle must be "ON", so enable autoplaying
if interaction.guild.id in self.bot.autoplay:
- embed = discord.Embed(
+ embed = create_embed(
title="Autoplay Already Enabled",
description=(
"Autoplay is already enabled. If you would like to turn it"
" off, choose the `OFF` option in the"
" </autoplay:1228216490386391052> command."
),
- color=BOT_COLOR,
)
return await interaction.response.send_message(
embed=embed, ephemeral=True
@@ -53,7 +51,7 @@ class Autoplay(commands.Cog):
player = self.bot.lavalink.player_manager.get(interaction.guild.id)
if len(player.queue) < 5:
- embed = discord.Embed(
+ embed = create_embed(
title="Not Enough Context",
description=(
"You must have at least 5 songs in the queue so that I can"
@@ -61,13 +59,6 @@ class Autoplay(commands.Cog):
" to play. Add some more music to the queue, then try"
" again."
),
- 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
@@ -77,13 +68,12 @@ class Autoplay(commands.Cog):
for song in player.queue[:10]:
inputs[song.title] = song.author
- embed = discord.Embed(
+ embed = create_embed(
title="Getting AI Recommendations",
description=(
"Attempting to generate recommendations based on the current"
" songs in your queue. Just a moment..."
),
- color=BOT_COLOR,
)
await interaction.response.send_message(embed=embed)
@@ -91,7 +81,7 @@ class Autoplay(commands.Cog):
self.bot.openai, self.bot.user, player, 5, inputs
):
self.bot.autoplay.append(interaction.guild.id)
- embed = discord.Embed(
+ embed = create_embed(
title=":infinity: Autoplay Enabled :infinity:",
description=(
"I have added a few similar songs to the queue and will"
@@ -99,12 +89,11 @@ class Autoplay(commands.Cog):
" just sit back and enjoy the music!\n\nEnabled by:"
f" {interaction.user.mention}"
),
- color=BOT_COLOR,
)
await interaction.edit_original_response(embed=embed)
else:
- embed = discord.Embed(
+ embed = create_embed(
title="Autoplay Error",
description=(
"Autoplay is an experimental feature, meaning sometimes it"
@@ -113,13 +102,6 @@ class Autoplay(commands.Cog):
" command again. If the issue persists, fill out a bug"
" report with the </bug:1224840889906499626> command."
),
- color=BOT_COLOR,
- )
- embed.set_footer(
- text=datetime.datetime.now(datetime.timezone.utc).strftime(
- "%Y-%m-%d %H:%M:%S"
- )
- + " UTC"
)
await interaction.edit_original_response(embed=embed)