如何让机器人在 discord.py
中为 channel 设置慢速模式改写?
我试过这样做:ctx.channel.slowmode_delay = 10
它没有出现任何错误,但是当我调用上述命令时,没有应用慢速模式。
我还可以做些什么?
最佳答案
这是一个示例命令:
@bot.command()
async def setdelay(ctx, seconds: int):
await ctx.channel.edit(slowmode_delay=seconds)
await ctx.send(f"Set the slowmode delay in this channel to {seconds} seconds!")
引用文献:
Context.channel
TextChannel.edit()
- 将延迟设置为 0 将禁用慢速模式。 关于python - 如何让机器人在 discord.py 重写中为 channel 设置慢速模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62244594/