简体   繁体   中英

Keep getting the error "command is not found"

["
class ModCommands(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
    
    def create_command_embed(self, ctx):
      moderator=ctx.author.display_name
      disc_server=ctx.guild_name
      reason= None
      ban_dm_embed=create_command_embed(self, ctx,
      "**Banned**", 
      "https://discord.gg/UQVB7hVTav",
      f"You were banned from {disc_server}",
      discord.Color.red(),
      f"Moderator{moderator}",
      ctx.author.avatar_url,
      f"`Reason: {reason}`",
      "`Case Number: [COMING SOON]`",
      '\u200b' "Spoon Bot",
      "https://i.imgur.com/gj4Veji.png")
      return ban_dm_embed

    @commands.command()
    async def ban(self, ctx):
        await ctx.message.reply(ban_dm_embed)

Solution 1: If You Are Using Discord.py V2 If You Use on_message Event Commands Will Get Bugged

Solution 2: How Did You Created That Embed ? Just Use ( discord.Embed( ) ) Why Are You Using Return? You Are Sending Embed. Soo Shouldnt You Use ctx.send(embed=ban_dm_embed) ?

Solution 3: Did You Added setup function on The Bottom of Your Code?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM