diff options
author | Parker <contact@pkrm.dev> | 2024-10-31 05:26:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 05:26:36 +0000 |
commit | 5be16a998857d1f14410904a41d052070d5f8776 (patch) | |
tree | 6b26a4dc377ccf209c37eabf673d6031fdc10987 /code/utils/command_tree.py | |
parent | c1b229f34c010108b0e7eb92de2102dfc07ae70c (diff) | |
parent | 70e612882d1093b133d13302dccfba6aa2778474 (diff) |
Merge pull request #9 from PacketParker/dev
`black --line-length 79`
Diffstat (limited to 'code/utils/command_tree.py')
-rw-r--r-- | code/utils/command_tree.py | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/code/utils/command_tree.py b/code/utils/command_tree.py index 947a58c..3d9214d 100644 --- a/code/utils/command_tree.py +++ b/code/utils/command_tree.py @@ -15,7 +15,9 @@ class CheckPlayerError(app_commands.AppCommandError): class Tree(app_commands.CommandTree): async def on_error( - self, interaction: discord.Interaction, error: app_commands.AppCommandError + self, + interaction: discord.Interaction, + error: app_commands.AppCommandError, ): music_commands = [ "play", @@ -48,7 +50,9 @@ class Tree(app_commands.CommandTree): + " UTC" ) try: - await interaction.response.send_message(embed=embed, ephemeral=True) + await interaction.response.send_message( + embed=embed, ephemeral=True + ) except discord.errors.InteractionResponded: await interaction.followup.send(embed=embed, ephemeral=True) @@ -60,7 +64,11 @@ class Tree(app_commands.CommandTree): ): embed = discord.Embed( title="Player Creation Error", - description="An error occured when trying to create a player. Please submit a bug report with </bug:1224840889906499626> if this issue persists.", + description=( + "An error occured when trying to create a player. Please" + " submit a bug report with </bug:1224840889906499626> if" + " this issue persists." + ), color=BOT_COLOR, ) embed.set_footer( @@ -70,7 +78,9 @@ class Tree(app_commands.CommandTree): + " UTC" ) try: - await interaction.response.send_message(embed=embed, ephemeral=True) + await interaction.response.send_message( + embed=embed, ephemeral=True + ) except discord.errors.InteractionResponded: await interaction.followup.send(embed=embed, ephemeral=True) @@ -78,7 +88,13 @@ class Tree(app_commands.CommandTree): elif isinstance(error, LoadError): embed = discord.Embed( title="Nothing Found", - description="Spotify does not allow direct play, meaning songs have to be found on a supported provider. In this case, the song couldn't be found. Please try again with a different song, or try searching for just the name and artist manually rather than sending a link.", + description=( + "Spotify does not allow direct play, meaning songs have to" + " be found on a supported provider. In this case, the song" + " couldn't be found. Please try again with a different" + " song, or try searching for just the name and artist" + " manually rather than sending a link." + ), color=BOT_COLOR, ) embed.set_footer( @@ -88,7 +104,9 @@ class Tree(app_commands.CommandTree): + " UTC" ) try: - await interaction.response.send_message(embed=embed, ephemeral=True) + await interaction.response.send_message( + embed=embed, ephemeral=True + ) except discord.errors.InteractionResponded: await interaction.followup.send(embed=embed, ephemeral=True) |