久久久久久久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>

                            主站蜘蛛池模板: 日日爽 | 日韩在线视频一区 | 欧美成人a∨高清免费观看 老司机午夜性大片 | 99热这里只有精品8 激情毛片 | 亚洲欧美日韩精品久久亚洲区 | 黄色免费在线观看 | 久久中文字幕一区 | 国产97视频在线观看 | 欧美大片在线观看 | 婷婷丁香在线视频 | 欧洲成人免费视频 | 免费观看毛片 | 福利网站在线观看 | 91视频a | 国产jizz女人多喷水99 | 欧美精品久久 | 美日韩中文字幕 | 欧美成人一区二免费视频软件 | h小视频 | 羞羞的视频免费看 | 成人在线观看中文字幕 | 欧美中文字幕一区 | 亚洲成人www | 日韩中文字幕一区 | 龙珠z在线观看 | 国产一区二区 | 欧美中文字幕一区 | 91av在线免费观看 | 欧美成人精品一区二区男人看 | 国产精品久久精品 | 国产精品精品视频一区二区三区 | 精品免费在线 | 国产福利久久 | 国产高清视频在线播放 | 波多野结衣精品 | 拍真实国产伦偷精品 | 四色成人av永久网址 | 亚洲一区二区在线视频 | 中文字幕久久久 | 国产成人jvid在线播放 | 91视频在线看 |