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