【发布时间】:2022-01-20 13:33:14
【问题描述】:
我有点难过。我试图让机器人询问他们是否确定要从频道中删除 50 条消息,说是或否,但每当我尝试制作 2 个 client.wait_for 时,它们似乎都不起作用。这是我目前得到的:
@commands.guild_only()
@commands.cooldown(1, 15, commands.BucketType.user)
@commands.has_role("Developer")
async def purge(ctx, amount=50):
await ctx.reply("This will delete the most recent **50** messages from this channel, are you sure?\n`yes`, `no`")
def check (message):
return message.content == 'yes' and message.channel
msglol = await client.wait_for('yes', check=check)
await ctx.channel.purge(limit=amount.format(msglol))
await ctx.reply("Done!", delete_after=5)
def check (message):
return message.content == 'no' and message.channel
msglmao = await client.wait_for('no', check=check)
await ctx.reply("Ok!".format(msglmao))```
【问题讨论】:
-
也没有——不是我没有放“@client.command()”我忘了把它粘贴到代码中;-;
标签: discord discord.py