aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/music.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-04-14 20:31:05 -0500
committerParker <contact@pkrm.dev>2024-04-14 20:31:05 -0500
commit760aac506f65f3d4c6765f545ad6444bd086b859 (patch)
tree3a4907ac0418bcf38d4cf7ed2f980834fbe95cd4 /code/cogs/music.py
parent3c66d50822caf7959bb85a17e93aa03bc6c3639b (diff)
Create/Implement `CheckPlayerError` error class
Diffstat (limited to 'code/cogs/music.py')
-rw-r--r--code/cogs/music.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/code/cogs/music.py b/code/cogs/music.py
index 7a3418c..729284d 100644
--- a/code/cogs/music.py
+++ b/code/cogs/music.py
@@ -8,6 +8,7 @@ from global_variables import (
LAVALINK_PASSWORD,
LAVALINK_PORT,
LOG,
+ CheckPlayerError,
)
from ai_recommendations import add_song_recommendations
@@ -135,14 +136,14 @@ class Music(commands.Cog):
if not interaction.user.voice or not interaction.user.voice.channel:
if voice_client is not None:
- raise app_commands.AppCommandError(
+ raise CheckPlayerError(
{
"title": "Not in my VC",
"description": "You must join my voice channel to run that command.",
}
)
- raise app_commands.AppCommandError(
+ raise CheckPlayerError(
{
"title": "No Channel",
"description": "You must join a voice channel before you can run that command.",
@@ -151,7 +152,7 @@ class Music(commands.Cog):
if voice_client is None:
if not should_connect:
- raise app_commands.AppCommandError(
+ raise CheckPlayerError(
{
"title": "Not Connected",
"description": "I am not connected and playing music right now, therefore that command will not work.",
@@ -163,7 +164,7 @@ class Music(commands.Cog):
)
if not permissions.connect or not permissions.speak:
- raise app_commands.AppCommandError(
+ raise CheckPlayerError(
{
"title": "Missing Permissions",
"description": "I need the `CONNECT` and `SPEAK` permissions in order to work.",
@@ -173,7 +174,7 @@ class Music(commands.Cog):
player.store("channel", interaction.channel.id)
else:
if int(player.channel_id) != interaction.user.voice.channel.id:
- raise app_commands.AppCommandError(
+ raise CheckPlayerError(
{
"title": "Not in my VC",
"description": "You must join my voice channel to run that command.",