aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/music.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-04-09 01:59:25 -0500
committerParker <contact@pkrm.dev>2024-04-09 01:59:25 -0500
commita550657990dfdef581bda3650a9500054c5e3262 (patch)
treee57f7e654365707a4902f03e382da8fcb1fdde3b /code/cogs/music.py
parentccc9d5c566d223642dcbf0de1071d382032afb7d (diff)
Remove `CreatePlayerError` just go back to `AppCommandError`
Diffstat (limited to 'code/cogs/music.py')
-rw-r--r--code/cogs/music.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/code/cogs/music.py b/code/cogs/music.py
index 1d8049b..077cb0a 100644
--- a/code/cogs/music.py
+++ b/code/cogs/music.py
@@ -11,11 +11,6 @@ from global_variables import (
)
-class CreatePlayerError(Exception):
- "Raised when the create_player function errors out"
- pass
-
-
class LavalinkVoiceClient(discord.VoiceProtocol):
"""
This is the preferred way to handle external voice sending
@@ -139,14 +134,14 @@ class Music(commands.Cog):
if not interaction.user.voice or not interaction.user.voice.channel:
if voice_client is not None:
- raise CreatePlayerError(
+ raise app_commands.AppCommandError(
{
"title": "Not in my VC",
"description": "You must join my voice channel to run that command.",
}
)
- raise CreatePlayerError(
+ raise app_commands.AppCommandError(
{
"title": "No Channel",
"description": "You must join a voice channel before you can run that command.",
@@ -155,7 +150,7 @@ class Music(commands.Cog):
if voice_client is None:
if not should_connect:
- raise CreatePlayerError(
+ raise app_commands.AppCommandError(
{
"title": "Not Connected",
"description": "I am not connected and playing music right now, therefore that command will not work.",
@@ -167,7 +162,7 @@ class Music(commands.Cog):
)
if not permissions.connect or not permissions.speak:
- raise CreatePlayerError(
+ raise app_commands.AppCommandError(
{
"title": "Missing Permissions",
"description": "I need the `CONNECT` and `SPEAK` permissions in order to work.",
@@ -177,7 +172,7 @@ class Music(commands.Cog):
player.store("channel", interaction.channel.id)
else:
if int(player.channel_id) != interaction.user.voice.channel.id:
- raise CreatePlayerError(
+ raise app_commands.AppCommandError(
{
"title": "Not in my VC",
"description": "You must join my voice channel to run that command.",