diff options
author | Parker <contact@pkrm.dev> | 2024-12-03 06:05:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 06:05:14 +0000 |
commit | 15e33831639355546b32477a6870eb0a3ac47e24 (patch) | |
tree | a5455e0a8391747c7226a751354b7236c8c5d40b /code/cogs/repeat.py | |
parent | fcbfe460701316ded25e29356ed1fda42386e5c0 (diff) | |
parent | ce18cd27488d90fbd0aae7319a36a89e9fa85aa7 (diff) |
Merge pull request #10 from PacketParker/dev
Update
Diffstat (limited to 'code/cogs/repeat.py')
-rw-r--r-- | code/cogs/repeat.py | 93 |
1 files changed, 12 insertions, 81 deletions
diff --git a/code/cogs/repeat.py b/code/cogs/repeat.py index cf745d5..50c241d 100644 --- a/code/cogs/repeat.py +++ b/code/cogs/repeat.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 Repeat(commands.GroupCog, name="repeat"): @@ -17,34 +17,11 @@ class Repeat(commands.GroupCog, name="repeat"): "Turn song/queue repetition off" player = self.bot.lavalink.player_manager.get(interaction.guild.id) - if player.loop == 0: - embed = discord.Embed( - title=f"Repeating Already Off", - description=f"Music repetition is already turned off.", - 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 - ) - player.loop = 0 - embed = discord.Embed( - title=f"Repeating Off", - description=f"Music will no longer be repeated.", - 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="Repeating Off", + description="Music will not be repeated.", ) await interaction.response.send_message(embed=embed) @@ -54,37 +31,14 @@ class Repeat(commands.GroupCog, name="repeat"): "Forever repeat that song that is currently playing" player = self.bot.lavalink.player_manager.get(interaction.guild.id) - if player.loop == 1: - embed = discord.Embed( - title=f"Repeating Already On", - description=f"The current song is already being repeated.", - 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 - ) - player.loop = 1 - embed = discord.Embed( - title=f"Repeating Current Song 🔁", + embed = create_embed( + title="Repeating Current Song 🔁", description=( - f"The song that is currently playing will be repeated until" - f" the </repeat off:1224840891395608737> command is run" + "The song that is currently playing will be repeated until" + " the </repeat off:1224840891395608737> command is run" ), - 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) @@ -94,37 +48,14 @@ class Repeat(commands.GroupCog, name="repeat"): "Continuously repeat the queue once it reaches the end" player = self.bot.lavalink.player_manager.get(interaction.guild.id) - if player.loop == 2: - embed = discord.Embed( - title=f"Repeating Already On", - description=f"The queue is already being repeated.", - 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 - ) - player.loop = 2 - embed = discord.Embed( - title=f"Repeating Current Song 🔂", + embed = create_embed( + title="Repeating Queue 🔂", description=( - f"All songs in the queue will continue to repeat until the" - f" </repeat off:1224840891395608737> command is run." + "The queue will continuously repeat until the" + " </repeat off:1224840891395608737> command is run." ), - 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) |