【发布时间】:2021-03-27 14:41:59
【问题描述】:
我只是想问我怎样才能发出命令,这将改变频道发送消息的冷却时间。就是这样。
【问题讨论】:
标签: python discord discord.py
我只是想问我怎样才能发出命令,这将改变频道发送消息的冷却时间。就是这样。
【问题讨论】:
标签: python discord discord.py
您可以使用slowmode_delay。
没有齿轮:
@client.command()
@commands.has_permissions(manage_messages=True) # Permission to use command
async def slowmode(self, ctx, seconds: int): # seconds
await ctx.channel.edit(slowmode_delay=seconds) # Edits the channel, (slowmode_delay = channel slowmode.
await ctx.send(f"I've set the slowmode to **{seconds}** seconds in {ctx.channel.mention}!") # Message sent after the slowmode is set.
齿轮:
@commands.command()
@commands.has_permissions(manage_messages=True)
async def slowmode(self, ctx, seconds: int):
await ctx.channel.edit(slowmode_delay=seconds)
await ctx.send(f"I've set the slowmode to **{seconds}** seconds in {ctx.channel.mention}!")
【讨论】: