【发布时间】:2021-11-04 12:33:11
【问题描述】:
我有一个代码:
@commands.has_permissions(ban_members=True)
@Client.command()
async def Ban (ctx, member:discord.User=None, reason="Nie podano"):
if member == None or member == ctx.message.author:
await ctx.channel.send("Nie możesz zbanować sam siebie")
return
message = f"Zostałeś zbanowany na serwerze {ctx.guild.name}\nPowód: {reason}"
await member.send(message)
await ctx.channel.purge(limit = 1)
await ctx.channel.send(f"{member} Został zbanowany!\nPowód: {reason}")
print('a')
await member.ban(reason = reason)
print('b')
一切都完成了,但是在控制台中显示字母“a”后,脚本停止运行
【问题讨论】:
标签: python discord discord.py