【问题标题】:How to make a command to change channel cooldown discord.py如何发出命令更改频道冷却时间 discord.py
【发布时间】:2021-03-27 14:41:59
【问题描述】:

我只是想问我怎样才能发出命令,这将改变频道发送消息的冷却时间。就是这样。

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:

    您可以使用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}!")
    

    Command Example

    【讨论】:

      猜你喜欢
      • 2021-03-11
      • 1970-01-01
      • 1970-01-01
      • 2021-04-06
      • 1970-01-01
      • 2021-05-13
      • 1970-01-01
      • 2021-03-30
      • 2021-05-15
      相关资源
      最近更新 更多