簡體   English   中英

不斷收到錯誤“找不到命令”

[英]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)

解決方案 1:如果您使用 Discord.py V2 如果您使用 on_message 事件命令將被錯誤

解決方案 2:您是如何創建嵌入的? 只需使用 (discord.Embed()) 為什么要使用 Return? 您正在發送嵌入。 Soo 你不應該使用 ctx.send(embed=ban_dm_embed) 嗎?

解決方案 3:您是否在代碼底部添加了設置功能?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM