K
K
Kirill Kolesnikov2020-11-12 04:32:16
Python
Kirill Kolesnikov, 2020-11-12 04:32:16

How to create a team in 2 words discord.py?

I want to make the bot accept, for example, the .voice command to open, but it gives an error, Command "voice" is not found

@commands.command(
    name = "closevoice",
    aliases = ["voice close"],
    usage = "voice close",   	
  )
  async def voice_close(self, ctx):
    pass

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pers1koFF, 2020-11-12
@Ox1i

Use @commands.group()
Example:

@commands.group(aliases=["войс"])
async def voice(self, ctx):
    pass

@voice.command(
    name = "closevoice",
    aliases = ["voice close"],
    usage = "voice close",   	
  )
async def voice_close(self, ctx):
    pass

Use like this: voice voice_close

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question