1
0
Fork 0

Raise CommandNotFound when error on subgroup command name

This commit is contained in:
Ethanell 2020-04-09 13:51:52 +02:00
parent a917c8a29f
commit 9e4cd64950

View file

@ -23,7 +23,9 @@ class Speak(commands.Cog):
@commands.guild_only()
async def speak(self, ctx: commands.Context):
if ctx.invoked_subcommand is None:
if ctx.author.voice is None or ctx.author.voice.channel is None:
if ctx.args:
raise CommandNotFound
elif ctx.author.voice is None or ctx.author.voice.channel is None:
await ctx.send("Your not in a voice channel !")
elif self.voice_chan is None:
await ctx.send("Voice channel not set !")