2021年1月28日星期四

discord.ext.commands.errors.MissingRequiredArgument

    class Misc(commands.Cog):      def __init__(self, bot):          self.bot = bot    @client.command()  @commands.has_permissions(administrator=True)  async def toggle(self, ctx, *, command):      command = self.bot.get_command(command)    if command is None:      await ctx.send("I can't find this command!!")    elif ctx.command == command:      await ctx.send("You cannot disable this command.")    else:      command.enabled = not command.enabled      ternary = "enabled" if command.enabled else "disabled"      await ctx.send(f"I have {ternary} {command.qualified_name} for you!")    def setup(bot):      bot.add_cog(Misc(bot))  

Error

error code : discord.ext.commands.errors.MissingRequiredArgument:   command is a required argument that is missing.  

What could be the problem?

https://stackoverflow.com/questions/65945561/discord-ext-commands-errors-missingrequiredargument January 29, 2021 at 05:35AM

没有评论:

发表评论