我是 Python 编码新手,我还不完全知道如何运行禁止命令,我尝试使用大量模板但似乎没有任何效果,我知道我可能只是愚蠢但有人可以帮忙吗?顺便说一下,我正在使用 replit 的 import discord 东西,因为我很懒惰,而且我不想经历所有这些麻烦。
下面是我当前的代码
client = commands.Bot(command_prefix='%')
#ban
@client.command()
@commands.has_permissions(ban_members=True)
async def ban (ctx, member:discord.User=None, reason =None):
if member == None or member == ctx.message.author:
await ctx.channel.send("you can't the do the does do the ban this member.")
return
if reason == None:
reason = "no reason provided"
message = f"you got been have the banned have from the {ctx.guild.name} for in the {reason}."
await member.send(message)
# await ctx.guild.ban(member, reason=reason)
await ctx.channel.send(f"{member} is now got the have been banned for {reason}")