久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      • <bdo id='CI2jh'></bdo><ul id='CI2jh'></ul>
      <tfoot id='CI2jh'></tfoot>
      <i id='CI2jh'><tr id='CI2jh'><dt id='CI2jh'><q id='CI2jh'><span id='CI2jh'><b id='CI2jh'><form id='CI2jh'><ins id='CI2jh'></ins><ul id='CI2jh'></ul><sub id='CI2jh'></sub></form><legend id='CI2jh'></legend><bdo id='CI2jh'><pre id='CI2jh'><center id='CI2jh'></center></pre></bdo></b><th id='CI2jh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CI2jh'><tfoot id='CI2jh'></tfoot><dl id='CI2jh'><fieldset id='CI2jh'></fieldset></dl></div>

      <small id='CI2jh'></small><noframes id='CI2jh'>

      1. <legend id='CI2jh'><style id='CI2jh'><dir id='CI2jh'><q id='CI2jh'></q></dir></style></legend>

        discord.py bot 獲得命令的剩余冷卻時間

        discord.py bot getting cooldown time remaining of command(discord.py bot 獲得命令的剩余冷卻時間)
        <tfoot id='JxUpO'></tfoot>

            <bdo id='JxUpO'></bdo><ul id='JxUpO'></ul>

            <small id='JxUpO'></small><noframes id='JxUpO'>

              <tbody id='JxUpO'></tbody>

              <legend id='JxUpO'><style id='JxUpO'><dir id='JxUpO'><q id='JxUpO'></q></dir></style></legend>
                  <i id='JxUpO'><tr id='JxUpO'><dt id='JxUpO'><q id='JxUpO'><span id='JxUpO'><b id='JxUpO'><form id='JxUpO'><ins id='JxUpO'></ins><ul id='JxUpO'></ul><sub id='JxUpO'></sub></form><legend id='JxUpO'></legend><bdo id='JxUpO'><pre id='JxUpO'><center id='JxUpO'></center></pre></bdo></b><th id='JxUpO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JxUpO'><tfoot id='JxUpO'></tfoot><dl id='JxUpO'><fieldset id='JxUpO'></fieldset></dl></div>
                • 本文介紹了discord.py bot 獲得命令的剩余冷卻時間的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在開發一個基于 python 的不和諧機器人,它具有以下命令

                  I'm working on a python based discord bot that has the following command

                  @client.command(name="Mine",
                              description="Mine daily.",
                              brief="Mine daily.",
                              aliases=['mine', 'm'],
                              pass_context=True)
                  @commands.cooldown(1, 30, commands.BucketType.user)
                  async def mine(ctx, arg):
                     <content>
                  

                  但是當用戶達到命令的 30 秒速率限制時,它會將錯誤輸出到 python shell

                  But when users hit the 30 second rate limit of the command it outputs the error to the python shell

                  Ignoring exception in command Mine
                  Traceback (most recent call last):
                     File "C:Users
                  anerAppDataLocalProgramsPythonPython36libsite- 
                        packagesdiscordextcommandsot.py", line 846, in process_commands
                        yield from command.invoke(ctx)
                     File "C:Users
                  anerAppDataLocalProgramsPythonPython36libsite- 
                        packagesdiscordextcommandscore.py", line 367, in invoke
                        yield from self.prepare(ctx)
                     File "C:Users
                  anerAppDataLocalProgramsPythonPython36libsite- 
                        packagesdiscordextcommandscore.py", line 351, in prepare
                        raise CommandOnCooldown(bucket, retry_after)
                  discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try 
                  again in 28.58s
                  

                  我想要做的是獲得剩余的冷卻時間并將其放入可以在不和諧中回復給用戶的東西,例如'此命令限速,請在28.58s后重試'

                  What I want to do is have something that gets the remaining cooldown and puts it into something that can be said back to the user on discord e.g. 'This command is ratelimited, please try again in 28.58s'

                  我無法在網上找到很多幫助,而且大部分已經過時或似乎不起作用.

                  I haven't been able to find much help for this online, and most of it is outdated or doesn't seem to work.

                  謝謝!

                  推薦答案

                  你需要寫一個 錯誤處理程序 用于處理 CommandOnCooldown 錯誤并發送消息.

                  You'll need to write an error handler for your command that handles the CommandOnCooldown error and sends the message.

                  @mine.error
                  async def mine_error(ctx, error):
                      if isinstance(error, commands.CommandOnCooldown):
                          msg = 'This command is ratelimited, please try again in {:.2f}s'.format(error.retry_after)
                          await ctx.send(msg)
                      else:
                          raise error
                  

                  這篇關于discord.py bot 獲得命令的剩余冷卻時間的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)

                        <tbody id='TMuxF'></tbody>

                      <legend id='TMuxF'><style id='TMuxF'><dir id='TMuxF'><q id='TMuxF'></q></dir></style></legend>

                        <tfoot id='TMuxF'></tfoot>
                      • <small id='TMuxF'></small><noframes id='TMuxF'>

                        <i id='TMuxF'><tr id='TMuxF'><dt id='TMuxF'><q id='TMuxF'><span id='TMuxF'><b id='TMuxF'><form id='TMuxF'><ins id='TMuxF'></ins><ul id='TMuxF'></ul><sub id='TMuxF'></sub></form><legend id='TMuxF'></legend><bdo id='TMuxF'><pre id='TMuxF'><center id='TMuxF'></center></pre></bdo></b><th id='TMuxF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TMuxF'><tfoot id='TMuxF'></tfoot><dl id='TMuxF'><fieldset id='TMuxF'></fieldset></dl></div>
                          <bdo id='TMuxF'></bdo><ul id='TMuxF'></ul>

                            主站蜘蛛池模板: 欧美久久久久久久 | 日韩精品久久久久久 | 欧美精品一区二区三区在线 | 日本午夜精品一区二区三区 | 成人在线观看免费视频 | 欧美精品一区三区 | 日日操日日干 | 在线不卡av | 亚洲综合视频 | 蜜桃日韩| 国产午夜精品一区二区三区在线观看 | 亚洲精品成人 | 插插宗合网 | 日韩国产一区二区三区 | 毛片免费视频 | 午夜久久久 | 成人精品久久 | 久久久久久99 | 中文字幕在线电影观看 | 成人水多啪啪片 | 日韩在线欧美 | 中文字幕日韩欧美一区二区三区 | 国产激情视频 | 日韩三级免费网站 | 精品一区二区不卡 | 97人人超碰 | 97精品超碰一区二区三区 | 中文字幕一二三区 | 日本又色又爽又黄又高潮 | 亚洲日本欧美日韩高观看 | 夜夜精品浪潮av一区二区三区 | 日韩中文字幕久久 | 欧美日本在线 | 日韩欧美中文字幕在线视频 | 亚洲网址在线观看 | a精品视频 | 产真a观专区 | 精品久久九 | 免费观看一级特黄欧美大片 | 国产精品自产av一区二区三区 | 久久婷婷国产麻豆91 |