Improve error messages
This commit is contained in:
parent
4bc1cdaae2
commit
fbb51bb0e1
|
@ -95,7 +95,7 @@ class Music(commands.Cog):
|
||||||
async def skip(self, ctx):
|
async def skip(self, ctx):
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
if ctx.voice_client is None or not ctx.voice_client.is_playing():
|
if ctx.voice_client is None or not ctx.voice_client.is_playing():
|
||||||
raise commands.CommandError("Cannot skip: No song playing")
|
raise commands.CommandError("No song playing")
|
||||||
ctx.voice_client.stop()
|
ctx.voice_client.stop()
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
|
@ -108,7 +108,7 @@ class Music(commands.Cog):
|
||||||
if ctx.author.voice:
|
if ctx.author.voice:
|
||||||
await ctx.author.voice.channel.connect()
|
await ctx.author.voice.channel.connect()
|
||||||
else:
|
else:
|
||||||
raise commands.CommandError("Author not connected to a voice channel.")
|
raise commands.CommandError("Author not connected to a voice channel")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -8,8 +8,7 @@ class BotMessage(discord.Embed):
|
||||||
class ErrorMessage(BotMessage):
|
class ErrorMessage(BotMessage):
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
title="Error",
|
title=f"Error: {message}",
|
||||||
description=message,
|
|
||||||
color=discord.Color.red()
|
color=discord.Color.red()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue